Sub-grouping in a plot in R -
i want represent data different individual cells in xyplot , give them color in base of different category. however, when have been able represent dots: xyplot( signal ~ time | as.factor(treatment), data=data,groups=cell, fill.color = as.character(data$color), panel = function(x, y,fill.color,...,subscripts){ fill = fill.color [subscripts] panel.xyplot(x, y,pch=19, col=fill, type ="p")} ) but in way imposible visually track cells. therefore, want same lines , polygons error area happens each time try, lattice override second group should assign color (or not able tell lattice. here way that: cell<-rep(x = c("a","b","c","d"),50) signal<-rep(sample(seq(from = 0, = 50, = 1), size = 50, replace = true),4) time<-sort(rep(seq(1,50),4),decreasing = f) treatment<-rep(c("hard","soft"),50*2) color<-rep(c("red","orange"),50*2) data<-data.frame(c...