df=data.frame(country=c("A","A","A","B","B","B"),
    food=rep(c("Apples","Pears","Bananas"),2),
    X2000=c(4,5,6,7,6,8),
    X2001=c(4,5,6,7,6,8),
    X2002=c(4,5,6,7,6,8),
    X2003=c(4,5,6,7,6,8));

I have data in the above form trying to get a plot of each fruit over time
year conditioned on country and food.

I tried,

xyplot(X2000+X2001+X2002+X2003~2000:2003|country*food,df)

But think I need to transform the data, just not sure
how.  Any help gratefully received.

Cheers,
Geoff.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to