I'm having problems using RPy to create a data.frame which is passed
to an R function.
The problem is that I need to initialize the data.frame with the
parameters in a specified order. The normal way, of doing
r.data_frame(MW=120.3, NUM_C=5, SMILES="c1ccccn1")
does not work because the parameter order is not a well defined
property, while in R is seems to be fixed. That is, "MW" in this
case is the first parameter, "NUM_C" is the second, and "SMILES" is
the third.
This is important because some of the code I have to deal with
turns the data.frame input into a matrix.
I got things working the hard and wrong way. I did
r("data.frame(MW=120.3, NUM_C=5, SMILES='c1ccccn1')")
along with asking RPy to not convert the returned data.frame into a
dictionary.
That works, but I'm worried about proper escape rules. Eg, what
happens if the string contains a "'" character?
The only other trick I could think of would be to assign the
inputs to a temporary variable, at the Python side of thing (letting
RPy handle the escapes) then refer to the R variables inside of the
data.frame() function call.
I looked in the archive and online but I couldn't find a better
way to do this.
Do any of you all have any ideas?
Andrew
[EMAIL PROTECTED]
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
rpy-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rpy-list