D. R. Evans said the following at 09/05/2007 03:59 PM : > Peter said the following at 09/05/2007 03:25 PM : > >> from rpy import r >> r("d <- load('/tmp/dat.R')") >> r("d <- subset(d, web == 'future')") >> print r("d") >> > > Oh, I didn't realise that one could simply write r("r-command-goes-here"). > In that case I think I'm fine, because I have working R code, so I can > probably just encapsulate it in r() calls. > > I'll go try that, anyway. Thank you very much.
Hmmm... that part works, but then as soon as I have obtained the right subset, the next commands fail. The following works fine in R: <several subset statements to extract an ever-decreasing portion of the data, and place it into the R object d> attach(d) lo <- loess(percent ~ ncms * ds, d, control=loess.control(trace.hat = 'approximate')) but when I convert these to: r("attach(d)") r"(lo <- loess(percent ~ ncms * ds, d, control=loess.control(trace.hat = 'approximate'))") I get: r("lo <- loess(percent ~ ncms * ds, d, control=loess.control(trace.hat = 'approximate'))") File "/usr/lib/python2.4/site-packages/rpy.py", line 198, in __call__ return self.eval(self.parse(text=s)) rpy.RException: Error: NA/NaN/Inf in foreign function call (arg 2) :-( ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list