Skip to content
Prev 148302 / 398500 Next

stuck on making a line graph across time, with 4 categories

Christopher W. Ryan <cryan <at> binghamton.edu> writes:
assuming "studentid" is your students,

library(lattice)
xyplot(studentid~startyear,groups=cat,auto.key=TRUE,type="l",data=data)

  (I think -- haven't tested at all)
  that, or reshape the data to wide format and use matplot.

  Ben Bolker