data(usethnicity)
race<-as.mr(strsplit(as.character(usethnicity$Q5),""))
mtable(race)
race<-mr_drop(race,c(" ","F","G","H"))
mtable(race)
## to keep just specified levels use [
mtable(race[,c("A","D")])
## How many do people identify with
table(mr_count(race))
data(nzbirds)
seenbirds<-as.mr(nzbirds>0)
countbirds<-mr_count(seenbirds)
## How many types of birds were seen
table(countbirds)
data(ethnicity)
ethnicity
mr_na(ethnicity, FALSE)
Run the code above in your browser using DataLab