pyramid.plot {nipnTK} | R Documentation |
Pyramid plot function for creating population pyramids.
Description
Pyramid plot function for creating population pyramids.
Usage
pyramid.plot(
x,
g,
main = paste("Pyramid plot of", deparse(substitute(x)), "by", deparse(substitute(g))),
xlab = paste(deparse(substitute(g)), "(", levels(as.factor(g))[1], "/",
levels(as.factor(g))[2], ")"),
ylab = deparse(substitute(x)),
col = "white",
...
)
Arguments
x |
Vector of ages (usually grouped) |
g |
Vector of groups (usually sex) |
main |
Plot title |
xlab |
|
ylab |
|
col |
Colours for bars. Either a single colour (default is
|
... |
Other graphical parameters |
Value
A table of x
by g
(invisible)
Examples
# Use pyramid.plot() on anthropometric data from a SMART survey in
# Kabul, Afghanistan (dp.ex02)
svy <- dp.ex02
pyramid.plot(svy$age, svy$sex)
[Package nipnTK version 0.2.0 Index]