- country
A country name or vector of country names. Can be specified as ISO-2 codes
as well. Use country = "all"
to request all countries available in
the IDB.
- year
A single year or vector of years for which you'd like to request data.
- variables
A character string or vector of variables representing data you would like
to request. If you are specifying an age or sex subset, this should be kept as NULL
as the function will return data from the 1-year-of-age IDB API.
If filtering by age or sex, should be NULL.
- concept
Variables in the IDB are organized by concepts; if specified, request all
variables for a given concept. Use idb_concepts()
to view
available concepts.
- age
A vector of ages for which you would like to request population data. If specified, will return data from the 1-year-age-band IDB API. Should not be used when
variables
is not NULL
.
- sex
One or more of "both", "male", or "female". If specified, will return data
from the 1-year-age-band IDB API. Should not be used when variables
is not NULL
.
- geometry
If TRUE
, returns country simple feature geometry along with your data
which can be used for mapping. Geometry is obtained using the rnaturalearthdata
R package.
- resolution
one of "low"
for lower-resolution (less-detailed) geometry, or #' "high"
for more detailed geometry. It is recommended to use the low-
resolution geometries for smaller-scale (e.g. world) mapping, and the
higher-resolution geometries for medium-scale (e.g. regional) mapping.
- api_key
Your Census API key. Can be supplied as part of the function call or
set globally with the idb_api_key()
function. If you are a tidycensus
user with your API key already stored, get_idb()
will pick up the
API key from there, and no further action from you is required.