[R] commandArgs()

About this list Date view Thread view Subject view Author view Attachment view

From: R A F (raf1729@hotmail.com)
Date: Tue 06 May 2003 - 00:34:57 EST


Message-id: <Law11-F120XHwGrRDyj00024819@hotmail.com>

Apologies for asking about this, but I don't quite understand how
this works after looking through the FAQ and the Help archives.

Let's say I want to pass "1000" as an argument to R. I did the
following:

>R CMD BATCH --1000 infile outfile

When I do print( commandArgs() ), I see

[1] ".../R.bin" "--restore"
[3] "--save" "--no-readline"
[5] "gui=none" "--1000"

So commandArgs()[6] is the argument I want. Does one then go on and
remove the "--" manually and cast this as numeric? If so, what's the
usual way to do this? Or am I not understanding this mechanism
properly?

Thanks very much.

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:45 EST