Hello everyone,

I'm trying to port the following R code to rpy2:

plots<-ggplot(pz_r,aes(x=z))+geom_histogram(aes(y=..density..),binwidth=bw)+geom_line(data=zfunc,aes(x=z,y=dens))

where pz_r is a data frame of observations of the random variable z,
and zfunc is a data frame with the probability density function (z and
dens). Currently, I've been able to port the histogram more or less
using:

pp=ggplot2.ggplot(pz_r)+ggplot2.aes_string(x='z')+ggplot2.geom_histogram(ggplot2.aes_string(y='..density..'),binwidth=bw)

However, I'm not sure how to get geom_line() to use the zfunc data frame:

pp=pp+ggplot2.geom_line(zfunc,ggplot2.aes_string(x='z',y='dens'))

I get
Error: ggplot2 doesn't know how to deal with data of class uneval

I'm using rpy2 2.1.0dev. Help with this would be much appreciated. Thank you.

Faisal Moledina

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to