View source: R/cansim_parquet.R
get_cansim_connection | R Documentation |
Retrieves a data table using an NDM catalogue number as parquet, feather, or SQLite database connection. Retrieved table data is cached permanently if a cache path is supplied or for duration of the current R session. If the table is cached the function will check if a newer version is available and emit a warning message if the cached table is out of date.
get_cansim_connection(
cansimTableNumber,
language = "english",
format = "parquet",
partitioning = c(),
refresh = FALSE,
timeout = 1000,
cache_path = getOption("cansim.cache_path")
)
cansimTableNumber |
the NDM table number to load |
language |
|
format |
(Optional) The format of the data table to retrieve. Either |
partitioning |
(Optional) Partition columns to use for parquet or feather formats. |
refresh |
(Optional) Valid options are |
timeout |
(Optional) Timeout in seconds for downloading cansim table to work around scenarios where StatCan servers drop the network connection. |
cache_path |
(Optional) Path to where to cache the table permanently. By default, the data is cached in the path specified by 'getOption("cansim.cache_path")', if this is set. Otherwise it will use 'tempdir()'. |
A database connection to a local parquet, feather, or sqlite database with the StatCan Table data. The data frames after calling 'collect()' or 'collect_and_normalize()' are identical up to possibly different row order.
## Not run:
con <- get_cansim_connection("34-10-0013")
# Work with the data connection
glimpse(con)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.