Justin R. answered 11/22/20
Ph.D. in Geophysics. Teaching at the university level since 1990.
I'm not sure how the call:
gg <- ggplot(data=mydata,aes(y=somevalues,x=datefield,color=category)) + layer(geom="line")
is producing anything. You need to define the stat and position of the layer (they default to NULL).
Try this instead:
gg <- ggplot(data=mydata,aes(y=somevalues,x=datefield,color=category)) +
layer(geom="line", stat = "identity", position = "identity")
or
gg <- ggplot(data=mydata,aes(y=somevalues,x=datefield,color=category)) + geom_line()