Читать книгу The Big R-Book - Philippe J. S. De Brouwer - Страница 44

Batch mode

Оглавление

R is an interpreted language and while the usual interaction is typing commands and getting the reply appear on the screen, it is also possible to use R in batch mode.

batch mode

functions

1 create a file test.R

2 add the content print(“Hello World”)

3 run the command line Rscript test.R

4 now, open R and run the command source(“test.R”)

source()

1 add in the file

my_function <- function(a,b) { a + b }

1 now repeat step 4 and run my_function(4,5)

In this section we will present you with a practical introduction to R, it is not a formal introduction. If you would like to learn more about the foundations, then we recommend the documentation provided by the R-core team here: https://cran.r-project.org/doc/manuals/r-release/R-lang.pdf.

The Big R-Book

Подняться наверх