[R-sig-eco] Why use Rpy?

Nicholas Lewin-Koh nikko at hailmail.net
Fri Jul 4 00:11:38 CEST 2008


Hi Phil,
The main reason would be for accessing R functionality in 
broader applications. Python does use a more efficient
memory model than R, however when using R functions
through rpy, R will still make copies with assignment within
called R functions, so I am not clear that there is any
gain on that front. Python is a very structured
language and is perhaps more consistent under the hood than
R is with its many legacy hiccups due to the next letter in
the alphabet. Also python has a cleaner object model than s4.

So really it is a nice mechanism to access R functionality from python
programs. So for creating plots in web applications using django,
or using other python treats that are much further developed than in
R.

Hope this helps

Nicholas 


> ------------------------------
> 
> Message: 2
> Date: Wed, 02 Jul 2008 07:18:06 CDT
> From: Philip Dixon <pdixon at iastate.edu>
> Subject: [R-sig-eco] Why use Rpy?
> To: r-sig-ecology at r-project.org
> Message-ID: <200807021218.HAA03665 at isua5.iastate.edu>
> 
> What is the benefit of using Rpy?
> 
> I'm familiar with Python as a high-level compiled language.  Python
> was very popular here (Iowa State, Statistics) a few years ago to
> vastly speed up S+ simulation studies.  One could recode into Python
> a lot more quickly than recoding into C++.  Both Python and C++ were
> much faster than S+; I don't know how Python compares with native R.
> 
> Thanks,
> Philip Dixon
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Wed, 2 Jul 2008 10:31:59 -0700
> From: "Gregory, Matthew" <matt.gregory at oregonstate.edu>
> Subject: Re: [R-sig-eco] Why use Rpy?
> To: <r-sig-ecology at r-project.org>
> Message-ID:
> 	<451453C181B199458A55B2B1723FAC00014E0796 at SAGE.forestry.oregonstate.edu>
> 	
> Content-Type: text/plain;	charset="us-ascii"
> 
> Philip Dixon wrote:
> > What is the benefit of using Rpy?
> > 
> > I'm familiar with Python as a high-level compiled language.  
> > Python was very popular here (Iowa State, Statistics) a few 
> > years ago to vastly speed up S+ simulation studies.  One 
> > could recode into Python a lot more quickly than recoding 
> > into C++.  Both Python and C++ were much faster than S+; I 
> > don't know how Python compares with native R.
> 
> I guess since I think I was the one who brought it up, I should probably
> explain my rationale.  The really glib answer (for me) is that I know
> Python and wasn't willing to learn another programming language for the
> small bit that I needed from R (probably not a very popular opinion on
> an R listserve ...).  RPy provides that relatively seamless link into R
> and given that most of our codebase is in Python, this was the path of
> least resistance for me.  There is also the RSPython package which has
> similar functionality to RPy.  
> 
> I can only speak to the benefits that I've found from Python, which
> isn't to say they don't exist in R - I'm just not fully aware of them.
> The main strength of Python for me is the vast array of amazing packages
> that are written for it.  This includes: 
> 
> -  Numpy/Scipy/matplotlib for array handling, scientific computing and
> graphing
> -  bindings for GDAL for abstract spatial translation and projection
> support
> -  PIL for image processing
> -  numerous other packages that have nothing to do with statistical
> computing
> 
> I realize that most of this functionality already exists in R, so
> probably not worth getting into Python if R fits your needs.  
> 
> As for speed, I can't speak to the R vs. Python question, although
> colleagues that are R users do complain about memory limitations and
> speed when running large spatial models.  Python will be slower than
> C/C++, but the things that *need* to be fast can be coded in C/C++ and
> be bound to Python using SWIG.
> 
> I'm sure that someone on this list probably has much more experience
> with both languages than I do and will provide a better answer.  
> 
> Matt Gregory
> Faculty Research Assistant
> Department of Forest Science
> Oregon State University
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> 
> 
> End of R-sig-ecology Digest, Vol 4, Issue 3
> *******************************************



More information about the R-sig-ecology mailing list