[R] Re: Feedback requested on a solution to specifying R-scripts on the command line

Mike R mike.rstat at gmail.com
Thu Jun 9 23:09:30 CEST 2005


On 6/8/05, Mike R <mike.rstat at gmail.com> wrote:
<snip>
> From the command line, I'd like to be able to start an
> interactive R session and at the same time, be able
> to specify on the command line a project-specific or
> task-specific script (R code) that is to be executed
> at the beginning of the session.

My new version of .First:


.First <- function() 
{ 
 print(version)
 cat("\n")
 CmdLineFilenames <<- strsplit(Sys.getenv("R_CUSTOM")," ")[[1]]
 for ( fn in CmdLineFilenames )
 {
  cat( "sourcing ", fn, "\n" )
  source(fn)
 }
 cat("\n")
}


Best,
Mike




More information about the R-help mailing list