Re: [R] command option for R CMD BATCH

2006-11-24 Thread Ramon Diaz-Uriarte
Thanks. R. On Thursday 23 November 2006 16:32, Prof Brian Ripley wrote: On Thu, 23 Nov 2006, Ramon Diaz-Uriarte wrote: On Thursday 23 November 2006 15:44, Prof Brian Ripley wrote: Try this: gannet% cat month.R x - commandArgs() print(x[length(x)]) gannet% R --slave --args

[R] command option for R CMD BATCH

2006-11-23 Thread Patrick Connolly
I wish to use R CMD BATCH to run a small R function which reads a text file and plots a single graph to a PDF file. version _ platform x86_64-unknown-linux-gnu arch x86_64 os linux-gnu

Re: [R] command option for R CMD BATCH

2006-11-23 Thread Vladimir Eremeev
Patrick Connolly p_connolly at ihug.co.nz writes: What I'd like to do is avoid the need to make the Month.r files and have the script pass the month information directly to the function that a single .r file would call. ?commandArgs __

Re: [R] command option for R CMD BATCH

2006-11-23 Thread Prof Brian Ripley
Try this: gannet% cat month.R x - commandArgs() print(x[length(x)]) gannet% R --slave --args January month.R [1] January On Thu, 23 Nov 2006, Patrick Connolly wrote: I wish to use R CMD BATCH to run a small R function which reads a text file and plots a single graph to a PDF file.

Re: [R] command option for R CMD BATCH

2006-11-23 Thread Ramon Diaz-Uriarte
On Thursday 23 November 2006 15:44, Prof Brian Ripley wrote: Try this: gannet% cat month.R x - commandArgs() print(x[length(x)]) gannet% R --slave --args January month.R [1] January Is the above R --slave --args January month.R the preferred way of using it? I tend to use R

Re: [R] command option for R CMD BATCH

2006-11-23 Thread Prof Brian Ripley
On Thu, 23 Nov 2006, Ramon Diaz-Uriarte wrote: On Thursday 23 November 2006 15:44, Prof Brian Ripley wrote: Try this: gannet% cat month.R x - commandArgs() print(x[length(x)]) gannet% R --slave --args January month.R [1] January Is the above R --slave --args January month.R the

Re: [R] command option for R CMD BATCH

2006-11-23 Thread Patrick Connolly
On Thu, 23-Nov-2006 at 02:44PM +, Prof Brian Ripley wrote: | Try this: | | gannet% cat month.R | x - commandArgs() | print(x[length(x)]) | | gannet% R --slave --args January month.R | [1] January That's exactly what I needed. Thank you Brian for a concise and thorough answer. --