Hi,
May be:
dat1<- read.table(text="city year sex obs
1 1990 M 25
1 1990 F 32
1 1991 M 15
1 1991 F 22
2 1990 M 42
2 1990 F 36
2 1991 M 12
2 1991 F 16",sep="",header=TRUE,stringsAsFactors=FALSE)
library(plyr)
#by city
d1 <- ddply(dat1,.(city
This is better for plotting the percents
likert(city ~ F + M | year, data=popwide, as.percent="noRightAxis",
main="F M population by city within year")
likert(year ~ F + M | city, data=popwide, as.percent="noRightAxis",
main="F M population by year within city")
We can also plot t
## I would use the likert function in the HH package
## if necessary
## install.packages("HH")
## install.packages("reshape")
library(HH)
library(reshape)
pop <- read.table(header=TRUE, text="
city year sex obs
1 1990 M 25
1 1990 F 32
1 1991 M 15
1 1991 F 22
2
3 matches
Mail list logo