Skip to content
Prev 320145 / 398503 Next

ggplot2 will not draw a rectangle. Error: ggplot2 doesn't know how to deal with data of class XXX"

ggplot(fcs,aes(x=year,y=federal.ps))+geom_line()+geom_rect(data=rectlib,aes(x=xmin,y=Inf,xmin=xmin,xmax=xmax),ymin=-Inf,ymax=Inf,fill="red",alpha=0.2)

For some reason x and y must be defined as data sources for all layers.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
John Kane <jrkrideau at inbox.com> wrote: