[R] A couple of batch mode questions

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Wed Jul 25 22:27:16 CEST 2018


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 in R. Numerous
tutorials elaborate on this.

If I have misunderstood, my apologies, and just disregard.

Cheers,
Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Wed, Jul 25, 2018 at 1:02 PM, Rich Shepard <rshepard using appl-ecosys.com>
wrote:

> 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 run the same .R script on each file,
> with any file-specific variables used in each one. Perhaps I'm not seeing
> how to pass parameters to the script call with source() so that the same .R
> script can be automagically run for each imput file name. In my newness to
> this it appears Rscript allows running the same script substituting inpu
> file names based on arguments on the Rscript command line.
>
> Regards,
>
> Rich
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posti
> ng-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]




More information about the R-help mailing list