dbInfo | R Documentation |
Reads a population database file (population, births, deaths) and returns list with unique
values for each of Year, Type, TypeID, Age and Sex. Database path can be either a full path
to a csv database file with the correct columns, or a vector including the data type, region type
and year of database to be used through getDBPath
. For example,
db_path = c("estimates", "HA", "19") would return info for the July 1st 2019 population
estimates database for Local Health Areas.
Note that dbCheck
is run before pulling info. User will be warned if any database
checks fail.
dbInfo(db_path, full_BC = TRUE)
db_path |
Either vector of database type ("estimates", "projections", "births", "deaths"), region code and two-character year OR full path to database csv file. |
full_BC |
Logical value whether the region covers all of BC. Those regions (e.g., CMAs) that do not cover all of BC have full_BC = FALSE, and their sum is not checked against the BC total. Default = TRUE. |
The complete list of region IDs and ages for each type of database (population, deaths, births)
can be found in dbutils
. For historical reasons, population data is saved as
POPRREYY (population estimates), POPRRPYY (population projections), BIRRRYY (births) or
DEARRYY (deaths), where RR is the shorthand for the region code, and YY is the last two digits
of the year.
List structure with unique values for Year, Type, TypeID, Age and Sex.
Sebastien Lavoie (formerly, BC Stats)
Overall package documentation: dbutils
()
Other database access helpers:
dbCheck()
,
dbRead()
,
dbWrite()
,
getDBPath()
## Not run: dbInfo("I://PopulationR/Database/Estimates/POPHAE19.csv") dbInfo(c("estimates", "HA", "19")) dbInfo(c("projections", "RD", "19"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.