[R] lattice histogram function and groups

From: Evans, David G (DFG) <david.evans_at_alaska.gov>
Date: Fri, 18 Mar 2011 16:41:39 -0800


Hi,

>From the following code (tweaked from another user):
 

variable<-sample(rep(1:2,100))

individual<-rep(1:3, length(variable))

group<-rep(LETTERS[1:2],length(variable)/2)

mydata<-data.frame(variable,individual,group)

individual<-as.factor(individual)

group<-as.factor(group)

histogram(~variable|individual+group)  

I get six panels, one for each of individuals 1-3 in group A and one for each of individuals 1-3 in group B .

What I want is three panels , one for each individual, but with A and B paired in the same panel. I think the "groups="argument does this sort of superposition for other lattice functions.  

Thanks very much for any help.    

        [[alternative HTML version deleted]]



R-help_at_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. Received on Sat 19 Mar 2011 - 01:13:03 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 01 Apr 2011 - 14:00:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive