My data frame df has these columns: token (a factor), date (a POSIXct), an count (an integer).
> head(df,3)
token date count
1 foo 10/1/2011 12:00:00 AM 6
2 bar 10/12/2011 12:00:00 AM 24
3 baz 10/14/2011 12:00:00 AM 4
I know how plot a time series for a factor ‘foo’, e.g. qplot(date, count, data=df[df$token == "foo",], geom="line");. But how do I plot the time series of all factors into the same chart, each factor line with a different color.
How do I plot the daily counts for the values in the token columns (e.g., foo, bar, baz) against and the dates? Basically counts on the y-axis and dates on the x-axis.
This is a hard question to answer without a reproducible example, but something like
qplot(date,count,data=df,group=token)may work.