[R] Passing parameters

Scott ncbi2r at googlemail.com
Fri Aug 26 00:03:39 CEST 2011


Hi Annie,
while I don't use python, I've been in similar positions.

here's a good link for the arguments function. It's the best
example/tutorial I've seen on the topic. It will also help you perhaps to
print the values of the arguments to screen/file within R to see if things
are going okay.

http://quantitative-ecology.blogspot.com/2007/08/including-arguments-in-r-cmd-batch-mode.html
http://quantitative-ecology.blogspot.com/2007/08/including-arguments-in-r-cmd-batch-mode.html 

remember that args is a list not a vector which is why you need two of [[
and two of ]].

given your R script say things like 
>print(Args) 
what do these parts of your code return? That would be the simplest way for
you (and us) to check what's going on. The example linked above should help.
The part where it loops through the expressions and parses them - that's a
good place to add a print(args[[i]])  statement onto the screen/output file
to see that things are being read in correctly.

so when you say the R script works correctly by itself, what is this command
you give? I suggest getting python to print the command to screen as well as
execute it, will help you. My guess is these two things differ and that
means it's probably more a python programming issue than an R one so you
might be better posting elsewhere in a python related forum.





--
View this message in context: http://r.789695.n4.nabble.com/Passing-parameters-tp3762480p3769532.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list