Here's how I do this:
The last lines of my .First() function are these:
## Run command line program if there is one
if(length(.cmd <- commandArgs(trailingOnly = TRUE)) > 0)
try(source(textConnection(.cmd), echo = T, prompt.echo = "> "))
and on my Linux path I have this csh script, called "runR"
rd...@stats.uwo.ca]
Inviato: mar 17/02/2009 17.34
A: mau...@alice.it
Cc: r-h...@stat.math.ethz.ch
Oggetto: Re: [R] R scripts and parameters
On 2/17/2009 10:55 AM, mau...@alice.it wrote:
A couple of weeks ago I asked how it is possible to run an R script (not a
function) passing some parameters.
S
elp is welcome.
Thank you.
Maura
-Messaggio originale-
Da: Duncan Murdoch [mailto:murd...@stats.uwo.ca]
Inviato: mar 17/02/2009 17.34
A: mau...@alice.it
Cc: r-h...@stat.math.ethz.ch
Oggetto: Re: [R] R scripts and parameters
On 2/17/2009 10:55 AM, mau...@alice.it wrote:
> A couple o
On 2/17/2009 10:55 AM, mau...@alice.it wrote:
A couple of weeks ago I asked how it is possible to run an R script (not a
function) passing some parameters.
Someone suggested the function "commandArgs()".
I read the on-line help and found no clarifying example. Therefore I do not
know how to use
Try this:
A <- 1
B <- 2
C <- 3
source("myfile.R")
Now the code in myfile can access A, B and C.
On Tue, Feb 17, 2009 at 10:55 AM, wrote:
> A couple of weeks ago I asked how it is possible to run an R script (not a
> function) passing some parameters.
> Someone suggested the function "commandA
A couple of weeks ago I asked how it is possible to run an R script (not a
function) passing some parameters.
Someone suggested the function "commandArgs()".
I read the on-line help and found no clarifying example. Therefore I do not
know how to use it appropriately.
I noticed this function retur
6 matches
Mail list logo