Skip to content
Prev 163576 / 398506 Next

command files

2008/12/2 b g <shakespeare_1040 at hotmail.com>:
You probably want R CMD BATCH from a command-line. For example, if myjob.R is:

x=runif(100)
y=runif(100)
m=lm(y~x)
summary(m)

 and I do:

R CMD BATCH myjob.R

from a command prompt then when it finishes I get a file "myjob.Rout"
which is a transcript file just like you'd see if you did things
interactively.

 Normally on a Unix box 'R' will be in your path so you can type it
just like that from a terminal window. From Windows, I'm not so sure,
so you may have to type the full path, like:

C:\Program Files\R-2.8.0\bin\R.exe CMD BATCH myjob.R

Barry