On Feb 11, 2008 7:30 PM, Hamish <[EMAIL PROTECTED]> wrote: > Dylan wrote: > > However, an hour spent tinkering around with the R shared lib > > examples left me mostly frustrated.... > > From the everything looks like a nail dept: > Does R offer SWIG bindings into the lib that we could use with python? > > > Hamish > >
This project (http://rpy.sourceforge.net/) comes to mind. Not sure if it is SWIG based... It looks like straight-up python: import Rpy ... I suppose that the only problem then is getting Rpy installed. On a debian-like system you can install R and Rpy via aptitude. If you build R from source, then I suppose you would have to build / install Rpy in a similar manner. Before giving up on the C-API to R, I think that there are a couple more approaches, which might be simpler. 1. call R in batch mode. this would involve the use of temp files, passing data and commands back and forth from GRASS to R-- with the shell as mediator. This would only require a vanilla install of R. 2. build R as a shared lib, and use the "embedded" interface to R commands. There are a couple examples in the source tree for this. However-- this is starting to get into the realm of feature bloat... As neat as it would be to have R routines which could work directly on GRASS data structures, it might be overkill considering the possible amount of work. I'll keep checking around and post back other ideas. On the other hand-- R has so many great plotting / analysis routines, it would be a shame to re-implement these in GRASS if they could be easily "plugged-into" via some kind of share library / SWIG interface. Dylan _______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
