[R] histograms with more than one variable

Liaw, Andy andy_liaw at merck.com
Thu Sep 30 22:23:17 CEST 2004


Sounds like you want something similar to:

library(lattice)
y <- rnorm(40)
group <- rep(1:2, each=20)
histogram(~y | group)

Andy

> From: Bill Shipley
> 
>  
> 
> y          group
> 
> 1.2       1
> 
> 3.3       1
> 
> 2.4       2
> 
> 5.7       1
> 
> 0.2       2
> 
> etc.
> 
>  
> 
> Bill Shipley
> 
> Subject Matter Editor, Ecology
> 
> North American Editor, Annals of Botany
> 
> Département de biologie, Université de Sherbrooke,
> 
> Sherbrooke (Québec) J1K 2R1 CANADA
> 
> Bill.Shipley at USherbrooke.ca
> 
 <http://callisto.si.usherb.ca:8080/bshipley/>
http://callisto.si.usherb.ca:8080/bshipley/

 


	[[alternative HTML version deleted]]

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html




More information about the R-help mailing list