Package: cansim 0.4.4

cansim: Accessing Statistics Canada Data Table and Vectors

Searches for, accesses, and retrieves Statistics Canada data tables, as well as individual vectors, as tidy data frames. This package enriches the tables with metadata, deals with encoding issues, allows for bilingual English or French language data retrieval, and bundles convenience functions to make it easier to work with retrieved table data. For more efficient data access the package allows for caching data in a local database and database level filtering, data manipulation and summarizing.

Authors:Jens von Bergmann [aut, cre], Dmitry Shkolnik [aut]

cansim_0.4.4.tar.gz
cansim_0.4.4.zip(r-4.7)cansim_0.4.4.zip(r-4.6)cansim_0.4.4.zip(r-4.5)
cansim_0.4.4.tgz(r-4.6-any)cansim_0.4.4.tgz(r-4.5-any)
cansim_0.4.4.tar.gz(r-4.7-any)cansim_0.4.4.tar.gz(r-4.6-any)
cansim_0.4.4.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
cansim/json (API)
NEWS

# Install 'cansim' in R:
install.packages('cansim', repos = c('https://mountainmath.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/mountainmath/cansim/issues

Pkgdown/docs site:https://mountainmath.github.io

On CRAN:

Conda:

8.66 score 49 stars 480 scripts 1.1k downloads 42 exports 47 dependencies

Last updated from:b7cf6b542e. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK151
source / vignettesOK203
linux-release-x86_64OK153
macos-release-arm64OK82
macos-oldrel-arm64OK116
windows-develOK88
windows-releaseOK105
windows-oldrelOK111
wasm-releaseOK125

Exports:add_cansim_vectors_to_templateadd_provincial_abbreviationscansim_old_to_newcansim_repartition_cached_tablecategories_for_levelcollect_and_normalizedisconnect_cansim_sqliteget_cansimget_cansim_changed_tablesget_cansim_code_setget_cansim_column_categoriesget_cansim_column_listget_cansim_connectionget_cansim_cube_metadataget_cansim_data_for_table_coord_periodsget_cansim_key_release_scheduleget_cansim_series_info_cube_coordget_cansim_sqliteget_cansim_table_infoget_cansim_table_last_release_dateget_cansim_table_notesget_cansim_table_overviewget_cansim_table_short_notesget_cansim_table_subjectget_cansim_table_surveyget_cansim_table_templateget_cansim_table_urlget_cansim_vectorget_cansim_vector_for_latest_periodsget_cansim_vector_infolist_cansim_cached_tableslist_cansim_cubeslist_cansim_sqlite_cached_tableslist_cansim_tablesnormalize_cansim_valuesremove_cansim_cached_tablesremove_cansim_sqlite_cached_tablesearch_cansim_cubessearch_cansim_tablesset_cansim_cache_pathshow_cansim_cache_pathview_cansim_webpage

Dependencies:arrowaskpassassertthatbitbit64blobcachemclicliprcpp11crayoncurlDBIdbplyrdigestdplyrfastmapgenericsgluehmshttrjsonlitelifecyclemagrittrmemoisemimeopensslpillarpkgconfigprettyunitsprogresspurrrR6readrrlangRSQLitestringistringrsystibbletidyrtidyselecttzdbutf8vctrsvroomwithr

Getting started with the cansim package

Rendered fromcansim.Rmdusingknitr::rmarkdownon May 19 2026.

Last update: 2025-08-19
Started: 2018-09-28

Partial table data download

Rendered frompartial_table_data_download.Rmdusingknitr::rmarkdownon May 19 2026.

Last update: 2025-05-30
Started: 2025-05-12

Working with large tables

Rendered fromworking_with_large_tables.Rmdusingknitr::rmarkdownon May 19 2026.

Last update: 2025-08-19
Started: 2021-05-10

Readme and manuals

Help Manual

Help pageTopics
Retrieve series info for given table id and coordinatesadd_cansim_vectors_to_template
Add provincial abbreviations as factoradd_provincial_abbreviations
Translate deprecated CANSIM table number into new NDM-format table catalogue numbercansim_old_to_new
Repartitions a cached cansim table to a new partitioning schemecansim_repartition_cached_table
Use metadata to extract categories for column of specific levelcategories_for_level
Collect data from a parquet, feather or sqlite query and normalize cansim table outputcollect_and_normalize
Disconnect from a cansim database connectiondisconnect_cansim_sqlite
Retrieve a Statistics Canada data table using NDM catalogue numberget_cansim
Retrieve a list of modified tables since a given dateget_cansim_changed_tables
Get NDM code setsget_cansim_code_set
Retrieve Statistics Canada data table categories for a specific columnget_cansim_column_categories
Retrieve Statistics Canada data table column listget_cansim_column_list
Retrieve a Statistics Canada data table using NDM catalogue number as parquet, feather, or sqlite database connectionget_cansim_connection
Retrieve table metadata from Statistics Canada APIget_cansim_cube_metadata
Retrieve data for specified Statistics Canada data product for last N periods for specific coordinatesget_cansim_data_for_table_coord_periods
Major economic indicator release scheduleget_cansim_key_release_schedule
Retrieve series info for given table id and coordinatesget_cansim_series_info_cube_coord
Retrieve Statistics Canada data table informationget_cansim_table_info
Get the latest release data for a StatCan table, if availableget_cansim_table_last_release_date
Retrieve Statistics Canada data table notes and column categoriesget_cansim_table_notes
Retrieve Statistics Canada data table overview textget_cansim_table_overview
Retrieve Statistics Canada data table short notesget_cansim_table_short_notes
Retrieve Statistics Canada data table subject detailget_cansim_table_subject
Retrieve Statistics Canada data table survey detailget_cansim_table_survey
Retrieve table template from Statistics Canada APIget_cansim_table_template
Retrieve a Statistics Canada data table URL given a table numberget_cansim_table_url
Retrieve data for a Statistics Canada data vector released within a given time frameget_cansim_vector
Retrieve data for specified Statistics Canada data vector(s) for last N periodsget_cansim_vector_for_latest_periods
Retrieve metadata for specified Statistics Canada data vectorsget_cansim_vector_info
List cached cansim arrow and SQlite databaseslist_cansim_cached_tables
Get overview list for all Statistics Canada data cubeslist_cansim_cubes
Remove cached cansim SQLite and parquet databaseremove_cansim_cached_tables
Search through Statistics Canada data cubessearch_cansim_cubes
Set persistent cansim cache locationset_cansim_cache_path
View saved cache directory pathshow_cansim_cache_path
View CANSIM table or vector information in browserview_cansim_webpage