[R] lattice histogram function and groups

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Apr 1 15:54:26 CEST 2011


On Sat, Mar 19, 2011 at 6:11 AM, Evans, David G (DFG)
<david.evans at alaska.gov> wrote:
> 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.

But not for histogram (intentionally).

See http://tolstoy.newcastle.edu.au/R/e2/help/07/04/14490.html

-Deepayan



More information about the R-help mailing list