Re: [R] A couple of batch mode questions

2018-07-25 Thread Rich Shepard
On Wed, 25 Jul 2018, Bert Gunter wrote: Eric may have more to say, but the straightforward answer is: use functions to do what you want and pass any file specific info to them as parameters of function calls. Bert, I was considering that functions would be the way to go. The functions can c

Re: [R] A couple of batch mode questions

2018-07-25 Thread Bert Gunter
Eric may have more to say, but the straightforward answer is: use functions to do what you want and pass any file specific info to them as parameters of function calls. If this seems arcane to you, then you have some homework to do, as using functions is a (maybe the) central programming paradigm

Re: [R] A couple of batch mode questions

2018-07-25 Thread Rich Shepard
On Wed, 25 Jul 2018, Eric Berger wrote: You should be able to do all this within R. From what you have written I don't see a compelling reason to use scripts at the shell level. Eric, The source() help page's last example calls a set of scripts to run sequentially. I assume this is used to

Re: [R] A couple of batch mode questions

2018-07-25 Thread Eric Berger
You should be able to do all this within R. >From what you have written I don't see a compelling reason to use scripts at the shell level. Best, Eric On Wed, Jul 25, 2018 at 9:41 PM, Rich Shepard wrote: > On Wed, 25 Jul 2018, Eric Berger wrote: > > 1. For R scripts you should also consider the

Re: [R] A couple of batch mode questions

2018-07-25 Thread Rich Shepard
On Wed, 25 Jul 2018, Eric Berger wrote: 1. For R scripts you should also consider the package littler developed by Dirk Eddelbuettel, Highly recommended. For info http://dirk.eddelbuettel.com/code/littler.html or the github repository. Eric, I'll definintely look at that package. 2. Scrip

Re: [R] A couple of batch mode questions

2018-07-25 Thread Rich Shepard
On Wed, 25 Jul 2018, MacQueen, Don wrote: From my perspective, which is a unix-alike perspective, Rscript makes R useable in exactly the same way as other unix style scripting languages such as perl, tcsh, bash, etc. This is useful, and a good thing. If I remember (and understood) correctly, it

Re: [R] A couple of batch mode questions

2018-07-25 Thread Eric Berger
Some additional comments that might be relevant to people interested in these topics. 1. For R scripts you should also consider the package littler developed by Dirk Eddelbuettel, Highly recommended. For info http://dirk.eddelbuettel.com/code/littler.html or the github repository. 2. Scripts can

Re: [R] A couple of batch mode questions

2018-07-25 Thread MacQueen, Don via R-help
From my perspective, which is a unix-alike perspective, Rscript makes R useable in exactly the same way as other unix style scripting languages such as perl, tcsh, bash, etc. This is useful, and a good thing. If I remember (and understood) correctly, it is why Rscript was introduced, later in R

Re: [R] A couple of batch mode questions [ANSWERED]

2018-07-25 Thread Rich Shepard
On Wed, 25 Jul 2018, Rich Shepard wrote: That's a given. Why would I prefer Rscript over R CMD BATCH, or vice-versa? I did not see much difference between the two in their help files. Digging deeper into the Web I read that R CMD BATCH is an older approach to automating R processing from th

Re: [R] A couple of batch mode questions

2018-07-25 Thread Rich Shepard
On Wed, 25 Jul 2018, Bert Gunter wrote: "Within R one can use source() to run a batch file of R commands, while R CMD BATCH and Rscript are run from the command line. Is this correct?" Yes. Bert, Thanks for confirming. I think your query answers your query: You use Rscript when you want

Re: [R] A couple of batch mode questions

2018-07-25 Thread Bert Gunter
"Within R one can use source() to run a batch file of R commands, while R CMD BATCH and Rscript are run from the command line. Is this correct?" Yes. I think your query answers your query: You use Rscript when you want to use R in the command environment, perhaps as part of an analytical pipeline

[R] A couple of batch mode questions

2018-07-25 Thread Rich Shepard
Within R one can use source() to run a batch file of R commands, while R CMD BATCH and Rscript are run from the command line. Is this correct? Given these choices, when would I want to run a script within R using source(), and when would it be better for me to run it from the command line?