powered by
Collect data from a parquet, feather or sqlite query and normalize cansim table output
collect_and_normalize( connection, replacement_value = "val_norm", normalize_percent = TRUE, default_month = "07", default_day = "01", factors = TRUE, strip_classification_code = FALSE, disconnect = FALSE )
A tibble with the collected and normalized data
A connection to a local arrow connection as returned by get_cansim_connection, possibly with filters or other dplyr verbs applied
get_cansim_connection
dplyr
(Optional) the name of the column the manipulated value should be returned in. Defaults to adding the `val_norm` value field.
(Optional) When true (the default) normalizes percentages by changing them to rates
true
The default month that should be used when creating Date objects for annual data (default set to "07")
The default day of the month that should be used when creating Date objects for monthly data (default set to "01")
(Optional) Logical value indicating if dimensions should be converted to factors. (Default set to FALSE).
FALSE
(Optional) Logical value indicating if classification code should be stripped from names. (Default set to false).
false
(Optional) Only used when format is sqlite. Logical value to indicate if the SQLite database connection should be disconnected. (Default is FALSE)
if (FALSE) { library(dplyr) con <- get_cansim_connection("34-10-0013") data <- con %>% filter(GEO=="Ontario") %>% collect_and_normalize() }
Run the code above in your browser using DataLab