> And if lattice is ok then try this:
>
> library(lattice)
> xyplot(Consumption ~ Quarter, group = Year, data, type = "o")
Or you can use ggplot:
install.packages("ggplot")
library(ggplot)
qplot(Quarter, Consumption, data=data,type=c("point","line"), id=data$Year)
Unfortunately this has uncovered a couple of small bugs for me to fix
(no automatic legend, and have to specify the data frame explicitly)
The slighly more verbose example below shows you what it should look like.
data$Year <- factor(data$Year)
p <- ggplot(data, aes=list(x=Quarter, y=Consumption, id=Year, colour=Year))
ggline(ggpoint(p), size=2)
Regards,
Hadley
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.