View source: R/plot.intsvy.table.R
plot.intsvy.table | R Documentation |
Functions pisa.table and piaac.table produce object of the class intsvy.table. The function plot.intsvy.table presents this table graphically.
## S3 method for class 'intsvy.table'
plot(x, se=FALSE, stacked=FALSE, centered = FALSE, midpoint = NA, ...)
x |
An object of the class intsvy.table returned by pisa.table or piaac.table functions. |
se |
If TRUE add whiskers for standard errors (only for stacked=FALSE). |
stacked |
If TRUE plot bars stacked one over another. |
centered |
If TRUE then bars will be centered around |
midpoint |
A single number, which specifies the segment around which bars are centered. By default it's the middle segment calculated as |
... |
Not used. Required for cran-check. |
Returns object of ggplot class with barplot. Works for one way, two-way and three-way contingency tables.
plot.intsvy.mean, plot.intsvy.reg
## Not run:
# 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.