[R] what is best for scripting?

paul sorenson sourceforge at metrak.com
Fri Dec 2 23:09:55 CET 2005


As I get more familiar with R I tend to find the need for massaging data 
with other scripts decreasing.

I still use python as a front end to some R tasks and it is a great 
language to have in your personal arsenal (as is R).

The kind of decision making process for me goes something like:

	o If R can read the data directly then use R.  I am pleasantly 
surprised at R in this regard.

	o If Python (or other scripting tool) already has bindings for dataset 
that you want, consider using Python.  Eg I extract software development 
metrics from Perforce with python for plotting in R.

	o If the data set has a complex grammar, choose a tool with support for 
grammar compilers (I use and recommend pyparsing but there are dozens of 
choices).  Actually I didn't check if there is a grammar compiler for R. 
  Someone mentioned BeautifulSoup not long ago for extracting stuff from 
broken HTML.  I have used this also with some success for extracting 
deeply nested tables in poorly written HTML.

I usually dump data from Python to R in CSV format.  I call R scripts 
from Python and about the only trick I use here is to read in an R 
script template and perform string variable expansion (interpolation in 
Perl) before sending it to an R process.  See attached for example.  For 
various reasons I have not used the R-Python bindings.

cheers


Molins, Jordi wrote:
> I am using R in Windows. I see that I will have to use batch processes with
> R. I will have to read and write text files, and run some R code; probably
> some external code too. I have never done scripting. Is there any document
> that explains simple steps with examples? I also have heard that Python is a
> good scripting language. Is it worth the effort? (I do not have too much
> free time, so if I could do without, much better ...).
> 
> Has anybody strong opinions on that? Past experiences?
> 
> Thank you!
> 
> Jordi
> 
> 
> 
> --------------------------------------------------------------------------------
> The information contained herein is confidential and is inte...{{dropped}}
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: R.py
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20051203/efa65ed2/R.pl


More information about the R-help mailing list