Sunday, June 19, 2011

Side-by-side histograms

In R, the lattice package provides a similarly direct approach.
ds = read.csv("http://www.math.smith.edu/r/data/help.csv")
ds$gender = ifelse(ds$female==1, "female", "male")
library(lattice)
histogram(~ cesd | gender, data=ds)


sources: http://sas-and-r.blogspot.com/2011/06/example-840-side-by-side-histograms.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SASandR+%28SAS+and+R%29

No comments:

Post a Comment