[R] Barplot w/ single stacked bar

hadley wickham h.wickham at gmail.com
Fri Jan 25 01:45:29 CET 2008


> I can reach my goal in ggplot2, although the relative heights of the
> bar's pieces don't seem quite right (it does generate a warning):
>
> library(ggplot2)
> x<-factor(1)
> y<-factor( c("Male","Male","Female") )
> mydata <- data.frame(x,y)
> rm(x,y)
> mydata

Ooops!  There was a bug in stat_bin that occurred when there was a
single categorical x value.  It'll be fixed in the next version.

Hadley


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



More information about the R-help mailing list