Hi,

I have no idea about LSF managed clusters, but on Windows at least I use
(and maybe you can try it):

Create a script file (.R) with:

#############################
toprint <- commandArgs()

length(toprint)

print(toprint)
#############################

Now moving to the command prompt, either specify the path to the script or
make sure it is in the same directory as I am currently in

prompt> C:\my\path\to\R\bin\R CMD BATCH --no-save "--args 1 3" -- myscript.R
myresults.txt

In my "myresults.txt" file, 1 and 3 are elements 8 & 9 in the vector
"toprint".  It seems like I recall reading that some of this is platform
dependent.

Best regards,

Josh

On Fri, Oct 1, 2010 at 10:23 PM, Thomas Stewart <tgstew...@gmail.com> wrote:
> On further review, it appears that & has nothing to do with the problems
I'm
> experiencing.  For some reason, the computer gods don't like --args 1 3.
 A
> solution I've found is outlined in the R-help archives:
> http://tolstoy.newcastle.edu.au/R/help/05/02/13163.html .
>
> If you know of another solution, please let me know.
>
> Thanks,
> -tgs
>
> On Fri, Oct 1, 2010 at 3:01 PM, Thomas Stewart <tgstew...@gmail.com>
wrote:
>
>> I'm trying to run R in batch mode on an LSF managed cluster.  In simple
>> settings, I can do it just fine.  The trouble I'm having is when I try to
>> pass arguments to the batch job.  For example,
>>
>> bsub R CMD BATCH --args 1 3 commandfile.R &
>>
>> LSF doesn't like the &, and it doesn't run.  I'm hoping one you can help
me
>> submit a job to an LSF cluster that allows me to pass arguments to R.
>>
>> Thank you,
>> -tgs
>>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to