Having solved this problem, I am posting this so that the next time I search
for how to do this I will find an answer...

Using qqmath(..., groups=num) creates a separate qq distribution for each
group (within a panel).  Using the 'col' or 'pch' argument does not
(usually) work because panel.qqmath sorts the data (but not 'col' or 'pch')
before plotting.  Sorting the data before calling qqmath will ensure that
the sorting does not change the order of the data.

For example, to obtain one distribution per voice part and color the point
by part 1 or part 2:

library(lattice)
singer <- singer
singer <- singer[order(singer$height),]
singer$part <- factor(sapply(strsplit(as.character(singer$voice.part), split
= " "), "[", 1),
         levels = c("Bass", "Tenor", "Alto", "Soprano"))
singer$num <- factor(sapply(strsplit(as.character(singer$voice.part), split
= " "), "[", 2))
qqmath(~ height | part, data = singer,
       col=singer$num,
       layout=c(4,1))



Kevin

        [[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