On 20/03/2009, at 9:17 AM, Lyman, Mark wrote:

Thanks for the suggestion Rolf. Unfortunately, this uses the BATCH
profile when I use for example R CMD INSTALL. I would like the BATCH
profile to be used only when R CMD BATCH is used. Sorry, about the
vagueness of my question.

I have found a way that approximates what I want to do. If I create a
new script file R2, with the only change from the regular R script file
being that I set and export the R_PROFILE variable, I can use this new
script file when I want to run BATCH jobs.

R2 --save --file=jobfile

Hmmm.  Try:

cargs <- commandArgs()
mmm   <- match("-f",cargs)
if(is.na(mmm)) {
        # Do the non-batch thing.
} else {
        # Do the batch thing.
}

Does that get you where you want to go?

        cheers,

                Rolf

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

______________________________________________
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