Peter wrote: > On Wed, Dec 17, 2008 at 1:00 AM, Marcos Silva <marcosfs2...@gmail.com> wrote: >> Hello People, it's me again... >> >> I tried to use the R's hist() function, using this code: >> >> hist = robjects.r['hist'] >> x = robjects.FloatVector(dataset) >> hist(x) >> ... >> But the graphic that I got was very strange... >> I cannot figure out what is wrong... > > By default, R uses the dataset's column names (or something like that) > which with rpy(2) have probably defaulted to some long string of their > actual data.
When robjects.FloatVector or other R object constuctors are used, an "anonymous" R variable is created in the embedded R. The sole representation of that object is the actual object's structure. This is what is returned by rpy2.robjects.RObject.r_repr(), and why it is possible to do things like robjects.r('hist(%s)' %x.r_repr()) > You'll see lots of strange text (mostly numbers) all > over your graphs as a result. You will need to explicitly set the > graph captions, and then everything is fine. Or bind the R object to a symbol known to R (and most likely in globalEnv). > Peter > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > rpy-list mailing list > rpy-list@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rpy-list ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list