I have a data.frame with the following characteristics:
+-----------------------------------------+ | earning budget ts total | +-----------------------------------------+ | 1 14 3 2012-01-18 11 | | 2 15 3 2012-01-19 23 | | 3 22 4 2012-01-20 42 | | 4 43 4 2012-01-21 82 | | 5 19 5 2012-01-22 98 | | 6 24 5 2012-01-23 119 | +-----------------------------------------+
And I am using the following code to get a ggplot
qplot(ts, total, data=res, geom="histogram")
But when I run the following code I get a graph without line?
qplot(ts, total, data=res, geom="line")
I tried
plot(res)
and that works fine.
Any idea why the “line” graph is not understanding my plot?
What data type is
ts? (What doesstr(YourDataFame$ts)give?) If it is character or factor, then you need to add agroup=1to theaes()when you make a line since otherwise it only draws lines per group, and each character/factor defines a different group (and thus eachxvalue is a separate group).