getDBPath | R Documentation |
Returns a population database file (population, births, deaths) path. Database paths are hardcoded to ensure consistency across population systems. The script uses data type, region type and year to return an appropriate full path.
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.
getDBPath(dbType, dbRegion, dbYear)
dbType |
Type of database being written. Possible values are "estimates", "projections", "deaths", "births". Default = "estimates". |
dbRegion |
Two-digit region code of the database. Possible values: "RD", "DR", "HA", "HS", "HY", "CH", "CF", "CA", "CL", "SD", "PS", "SR" as character. Default = NULL. |
dbYear |
Two-digit year of the data being saved. Based on July 1st reference date, as character. Default = NULL. |
Sebastien Lavoie (formerly, BC Stats)
Overall package documentation: dbutils
()
Other database access helpers:
dbCheck()
,
dbInfo()
,
dbRead()
,
dbWrite()
getDBPath(dbType = "estimates", dbRegion = "CA", dbYear = "17") ## "//.../POPCAE17.csv" getDBPath(dbType = "births", dbRegion = "RD", dbYear = "18") ## "//.../BIRRD18.csv"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.