I want to plot multiple facets with several lines each. In every facet, for the set of line plots, I would like to show a kind of smooth line representing a general trend for all those lines in a given particular facet. Does anybody know if it is possible? I have tried so far something like this:
ggplot(data = mydata, aes(x = x, y = y, group = group)) + geom_line('GRAY') + facet_wrap(~ class) + geom_smooth('loess')
(see figure)
However, what I observe is another line for every line plot within each facet, instead of a single line within every facet.
Thanks in advance