[R] Multiple stacked barplots on the same graph?

hadley wickham h.wickham at gmail.com
Tue Dec 4 19:15:51 CET 2007


On Dec 4, 2007 10:34 AM, Stéphane CRUVEILLER <scruveil at genoscope.cns.fr> wrote:
> Hi,
>
> I tried this method but it seems that there is something wrong with my
> data frame:
>
>
> when I type in:
>
>  > qplot(x=as.factor(Categorie),y=Total,data=mydata)
>
> It displays a graph with 2 points in each category...
> but if  I add the parameter geom="histogram"
>
>  > qplot(x=as.factor(Categorie),y=Total,data=mydata,geom="histogram")
>
>
> Error in storage.mode(test) <- "logical" :
>         object "y" not found
>
> any hint about this...

Could you copy and paste the output of dput(mydata) ?

(And I'd probably write the plot call as: qplot(Categorie, Total,
data=mydata, geom="bar"), since it is a bar plot, not a histogram)

-- 
http://had.co.nz/



More information about the R-help mailing list