[R] Re-sent to correct list: passing parameters

Thomas Lumley tlumley at u.washington.edu
Fri Nov 9 17:29:14 CET 2001


On Fri, 9 Nov 2001, Shravan Vasishth wrote:

> Hi,
>
> My apologies for sending this message earlier to the wrong list (next
> time I'll wait till I'm fully awake).
>
> I'm a new R user.  I want to do the following:
>
> I want to pass a filename to R repeatedly (about 400 times) in order to
> do a repetitive task (calculating regressions).
>
<snip>
> It works, but this is a really ugly hack, so my question is: is there a
> better way to do this? For example, is there some way to pass a
> filehandle as a parameter to R? From reading the manuals and old news
> posts and responses, it seems the answer is no. I'm thinking of a
> command like
>
> R --silent -slave < source.R  $f  >> outfile.test
>
> where $f will be used as the variable for the file to be converted to an
>
> object ("foo" in my toy example above).

THe commandArgs() function reports the arguments that R was called with.

	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list