On Mon, Jun 15, 2009 at 4:47 PM, Laurent Gautier<lgaut...@gmail.com> wrote: > > What is already not working in an R session has somewhat limited chances > of working with rpy2. > >> library(MASS) >> attach("birthwt") > Error in attach("birthwt") : file 'birthwt' not found > > The R function attach() is working on symbols, not on strings. > >> attach(get("birthwt")) > works, and so would in rpy2 > > r.attach(r["birthwt"]) > #note: detaching that one is left as an exercise for the reader. > > L.
That does help clarify things. In R these appear to be equivalent (the first using a string, the second a symbol): attach(get("birthwt")) attach(birthwt) Likewise for the library function, you can do either (string or symbol): library("MASS") library(MASS) So in rpy (or rpy2), we can call the library function with a string because R understands that. But, for attach, R does not expect a string, just a symbol, hence the failure. I think I have learnt a little more about R today :) Thank you, Peter ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list