[Rd] Where to drop a python script?
Marc Schwartz
marc_schwartz at me.com
Wed Oct 30 20:15:19 CET 2013
On Oct 30, 2013, at 1:54 PM, Jonathan Greenberg <jgrn at illinois.edu> wrote:
> R-developers:
>
> I have a small python script that I'd like to include in an R package I'm
> developing, but I'm a bit unclear about which subfolder it should go in. R
> will be calling the script via a system() call. Thanks!
>
> --j
See Writing R Extensions Manual, section 1.1.7:
http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Non_002dR-scripts-in-packages
If you want to see a package example, my WriteXLS package uses Perl, but the concepts will be the same:
https://github.com/marcschwartz/WriteXLS
If you look at WriteXLS.R around line 130, you can see an example of getting the $PATH to the included Perl scripts that I use, which are in the 'inst/Perl' folder. Further down around line 230, is where the script is called via system(). Note the use of shQuote() for some arguments.
Regards,
Marc Schwartz
More information about the R-devel
mailing list