On 12/10/2009 04:39 PM, Jim Lemon wrote:
On 12/10/2009 05:47 AM, terry johnson wrote:
How would I make a population histogram in R from an excel file? Thanks
Hi Terry,
library(gdata)
ozpop<-read.xls("ozpop.xls")
xycol<-color.gradient(c(0,0,0.5,1),c(0,0,0.5,1),c(1,1,0.5,1),18)
xxcol<-color.gradient(c(1,1,0.5,1),c(0.5,0.5,0.5,1),c(0.5,0.5,0.5,1),18)
library(plotrix)
par(mar=pyramid.plot(ozpop$Male,ozpop$Female,labels=ozpop$Age,
main="Australian population pyramid 2002",xycol=xycol,xxcol=xxcol))
Jim
Oops, sorry, XLS files must be verboten, as the example data I sent
seems to have disappeared.
Jim
______________________________________________
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.