This has nothing to do with your question, but instead of using >class=c(rep(1,3),rep(2,3),rep(3,3)) >
It's probably easier to use class = rep(1:3, each =3) [[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.