An interface for accessing a WPP indicator, where datasets with observed and predicted data are merged. The resulting data frame is in a "melted" format.
wpp.indicator(what, …)
Name of indicator. Possible values are:
Total fertililty rate. Merges datasets tfr
and tfrprojMed
.
Total population. Uses datasets with age- and sex-specific population counts and agregates over sexes and ages.
Total female population. Uses datasets popF
and popFprojMed
and aggregates over ages.
Total male population. Uses datasets popM
and popMprojMed
and aggregates over ages.
Total net migration. For wpp2019 and wpp2015, the dataset migration
is used. For wpp2012 and wpp2010 it aggregates datasets migrationF
and migrationM
over ages.
Annual migration rate per thousand population. The denominator is approximated with the average population (\((P_{t}+P_{t-1})/2\)).
Population by sex and age. Uses datasets popM
and popMprojMed
. It requires two arguments in …, namely sexm=c("F", "M")
and agem=c("0-4", "5-9", ..., "95-99", "100+")
. The function aggregates population counts over the given sex and age groups.
Mortality by sex and age. Uses datasets mxF
and mxM
. It requires two atguments in …, namely sex
which is either "F" or "M", and age
which is one of ("0", "1", "5", "10", "15", "20", ... "95", "100+").
Age-specific fertility rate. Uses datasets tfr
and tfrprojMed
which are merged together and dataset percentASFR
to derive age-specific rates. It requires one argument in …, namely age
which is one of ("15-19", "20-24", ..., "45-49").
Percent age-specific fertility. Corresponds to the dataset percentASFR
. Argument agem
as defined above giving one or more age categories is required.
Sex ratio at birth. Corresponds to the dataset sexRatio
.
Median age.
Mean age at childbearing.
Mean age of women in childbearing ages.
Total dependency ratio. Ratio of population of age 0 to 14 and 65+ to population of age 15-64.
Child dependency ratio. Ratio of population of age 0 to 14 to population of age 15-64.
Old-age dependency ratio. Ratio of population of age 65+ to population of age 15-64.
Potential support ratio. Inverse of old-age dependency ratio.
Average annual population growth (\(log(P_t / P_{t-1})/5\)).
Lower or upper bound of the corresponding indicator. Requires argument which.pi
which is one of “80”, “95”, “half.child”, and an argument bound
which is
either “low” or “high”. Arguments sexm
and agem
(as defined above, but of length one) are required for popagesex.ci.
Arguments passed to the underlying functions as described above.
Data frame with columns charcode
(alpha-2 ISO 3166 country code), Year
, and value
.
# NOT RUN {
tfr <- wpp.indicator("fert")
# }
# NOT RUN {
# Histogram of TFR
print(qplot(value, data=tfr) + facet_wrap(~ Year))
# }
# NOT RUN {
# }
# NOT RUN {
mxM01 <- wpp.indicator("mortagesex", sex="M", age="0")
# Plot map
plot(gvisGeoMap(tfr, locationvar='charcode', numvar='value'))
# }
Run the code above in your browser using DataLab