if (FALSE) {
# install pbiecek/PIAAC package from github to have access to piaac data
# age distribution in whole dataset
(ptable <- piaac.table(variable="AGEG10LFS", data=piaac))
# age distribution in whole dataset
plot(ptable)
plot(ptable, centered=TRUE)
# age distribution within countries
head(ptableC <- piaac.table(variable="AGEG10LFS", by="CNTRYID", data=piaac))
# age distribution within countries
plot(ptableC, stacked=TRUE)
plot(na.omit(ptableC), centered=TRUE)
# age distribution within countries and gender segments
head(ptableCA <- piaac.table(variable="AGEG10LFS", by=c("CNTRYID", "GENDER_R"), data=piaac))
# age distribution within countries and gender segments
plot(na.omit(ptableCA), stacked=TRUE)
plot(na.omit(ptableCA), centered=TRUE)
}
Run the code above in your browser using DataLab