[R] thanks

Jan T. Kim jtk at cmp.uea.ac.uk
Tue Jan 11 17:38:59 CET 2005


On Tue, Jan 11, 2005 at 03:59:58PM +0100, Cserh?ti M?ty?s wrote:

> I would like to run an R script from the Linux prompt. Is there any way 
> possible to do this? The reason is, the calculation that I'm doing takes a 
> few hours, and I would like to automatize it.
> 
> Or does it mean that I have to run source within the R prompt?
> 
> Or is there a way to do the automatization within the R prompt?

The standard way (well, my usual way, anyway) is to just use I/O
redirection:

    linux> R --vanilla < stuff.r

is, for the most part (see below), equivalent to

    linux> R
    > source("stuff.r");

The --vanilla option is necessary to suppress any interactive questions
concerning workspace saving (i.e. the "Save workspace image? [y/n/c]"
thing); differences between the automated and the interactive form may
be due to your script depending on some saved environment, or some
stuff in your init files.

I'd like to encourage you to automate your calculations, as this enhances
not only convenience but also reproducibility of your results.

Best regards, Jan
-- 
 +- Jan T. Kim -------------------------------------------------------+
 |    *NEW*    email: jtk at cmp.uea.ac.uk                               |
 |    *NEW*    WWW:   http://www.cmp.uea.ac.uk/people/jtk             |
 *-----=<  hierarchical systems are for files, not for humans  >=-----*




More information about the R-help mailing list