[R] system command to a specific shell (bash)

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Mon Apr 16 19:58:22 CEST 2012

You could make a hash bang bash script that sources the file and then proceeds to do whatever you want. Bourne shell should have no problems invoking another shell.
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
Sent from my phone. Please excuse my brevity.

Justin Haynes <jtor14 at gmail.com> wrote:

>I need to run a bash command, but when you call system() the default
>is sh (see my sessionInfo below).
>I found the shell command (
>but it seems to be disappeared in current versions of R?
>I am running all this from R CMD BATCH  with "system" calls to other R
>For a little more info, I'm generating sphinx documents (a python
>documentation library) through R and need to use a python virtual
>So I need to call system('source bin/activate'), but "source" isn't a
>recognized command in the sh shell...
>Any help is appreciated,
>> sessionInfo()
>R version 2.15.0 (2012-03-30)
>Platform: x86_64-pc-linux-gnu (64-bit)
> [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>          LC_NAME=C
> [9] LC_ADDRESS=C               LC_TELEPHONE=C
>attached base packages:
>[1] graphics  grDevices utils     datasets  stats     grid      methods
>other attached packages:
>[1] ggplot2_0.9.0  reshape2_1.2.1 plyr_1.7.1
>loaded via a namespace (and not attached):
>[1] colorspace_1.1-1   dichromat_1.2-4    digest_0.5.1      
>     memoise_0.1        munsell_0.3
>[7] proto_0.3-9.2      RColorBrewer_1.0-5 scales_0.2.0      
>     tools_2.15.0
>	[[alternative HTML version deleted]]
>R-help at r-project.org mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list