R Observatory
Search
install.packages("cancensus")
CRAN 30-day downloads, method
975+2.4% up on the 30 days before, the better direction
Test coverage, method
7%of lines run by tests

Integrated, convenient, and uniform access to Canadian Census data and geography retrieved using the 'CensusMapper' API. This package produces analysis-ready tidy data frames and spatial data in multiple formats, as well as convenience functions for working with Census variables, variable ...

Full description

Integrated, convenient, and uniform access to Canadian Census data and geography retrieved using the 'CensusMapper' API. This package produces analysis-ready tidy data frames and spatial data in multiple formats, as well as convenience functions for working with Census variables, variable hierarchies, and region selection. API keys are freely available with free registration at <https://censusmapper.ca/api>. Census data and boundary geometries are reproduced and distributed on an "as is" basis with the permission of Statistics Canada (Statistics Canada 1996; 2001; 2006; 2011; 2016; 2021).

Maintainer
Dmitry Shkolnik
Latest release
19 Jun 2026
First release
24 Jan 2018

Compare with another package

More details
Releases
28
Needs compilation
No
Needs R
>= 4.1
Config/roxygen2/version
8.0.0
LazyData
yes
Task views (1)

Earlier: Analysis of Spatial Data (until 23 Oct 2021).

Subjects (1) Method, Subjects
Cite

Package

Run in R for the authors' entry:

citation("cancensus")

The package provides a citation file, so citation() returns the authors' own entry.

R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA
Balamuta, J. J. (2026). R Observatory: Metrics for cancensus version 0.6.1 [Data set]. HJJB, LLC. Data release v2026-10-28. https://doi.org/10.5281/zenodo.21843040
About

From data release v2026-10-28, which the citation names so these numbers can be found later.

All 13 check platforms pass.

  • r-devel-linux-x86_64-debian-clang

    The unreleased R on Linux, x86_64, debian-clang

    OK

    Version checked
    0.6.1
    Time taken
    80 s
  • r-devel-linux-x86_64-debian-gcc

    The unreleased R on Linux, x86_64, debian-gcc

    OK

    Version checked
    0.6.1
    Time taken
    61 s
  • r-devel-linux-x86_64-fedora-clang

    The unreleased R on Linux, x86_64, fedora-clang

    OK

    Version checked
    0.6.1
    Time taken
    55 s
  • r-devel-linux-x86_64-fedora-gcc

    The unreleased R on Linux, x86_64, fedora-gcc

    OK

    Version checked
    0.6.1
    Time taken
    60 s
  • r-devel-windows-x86_64

    The unreleased R on Windows, x86_64

    OK

    Version checked
    0.6.1
    Time taken
    117 s
  • r-oldrel-macos-arm64

    The previous release of R on macOS, arm64

    OK

    Version checked
    0.6.1
    Time taken
    35 s
  • r-oldrel-macos-x86_64

    The previous release of R on macOS, x86_64

    OK

    Version checked
    0.6.1
    Time taken
    155 s
  • r-oldrel-windows-x86_64

    The previous release of R on Windows, x86_64

    OK

    Version checked
    0.6.1
    Time taken
    125 s
  • r-patched-linux-x86_64

    The patched release of R on Linux, x86_64

    OK

    Version checked
    0.6.1
    Time taken
    74 s
  • r-release-linux-x86_64

    The current release of R on Linux, x86_64

    OK

    Version checked
    0.6.1
    Time taken
    74 s
  • r-release-macos-arm64

    The current release of R on macOS, arm64

    OK

    Version checked
    0.6.1
    Time taken
    31 s
  • r-release-macos-x86_64

    The current release of R on macOS, x86_64

    OK

    Version checked
    0.6.1
    Time taken
    134 s
  • r-release-windows-x86_64

    The current release of R on Windows, x86_64

    OK

    Version checked
    0.6.1
    Time taken
    113 s
  • 13 OK

Over time

No change since 5 Aug 2026

As a list (5)
ChangedWorst statusOKNotesWarningsErrors
5 Aug 2026OK13000
1 Aug 2026Note12100
8 May 2026OK13000
7 May 2026Warning12010
10 Mar 2026OK14000

Since March 2026

Check results on CRAN

Total downloads in the last 30 days
1,068+4.5% up on the 30 days before, the better directionIt is the sum of 4 channels: CRAN, autoCRAN, conda-forge and c2d4u. r2u is switched off.

CRAN rank

3,726 of 26,530

CRAN

975 downloads in the last 30 days

Rank
3,726 of 26,530
Change
+2.4% up on the 30 days before, the better direction

It is in the total. Take it out

r2u

7 downloads in the last 30 days

Rank
7,875 of 30,526
Change
−36.4% down on the 30 days before, the worse direction

It is switched off. Put it back

autoCRAN

15 downloads in the last 30 days

Rank
3,005 of 29,212
Change
−21.1% down on the 30 days before, the worse direction

It is in the total. Take it out

conda-forge

76 downloads in the last 30 days

Rank
3,553 of 3,828
Change
+85.4% up on the 30 days before, the better direction

It is in the total. Take it out

c2d4u, no longer updated

2 downloads in the last 30 days

Rank
4,900 of 7,575
Change
−80% down on the 30 days before, the worse direction

It is in the total. Take it out

Over time

Compare downloads

Needs
8
Dependent packages
0
Suggested by
4
Needs (8)
Installing it adds
48 packages, 29.3 MB of source
Of those, need compilation
33
Optional extras (12)
Functions
63
Public exports
33
Lines of R code
2,927
Median complexity
4
Functions (63)
Size and composition

Lines by kind (5,615)

KindLinesShare
R code2,92752%
Tests4238%
Documentation1,27623%
Guides98918%

Lines by language

LanguageLinesShare
R3,35060%
Rd1,27623%
Vignettes98918%

Languages are counted from file extensions.

Files
99
R functions
63
Deprecated functions
1
Complexity
Median
4
Mean
5.75
Highest
53
Median lines per function
24
About complexity

Cyclomatic complexity counts the independent paths through a function: 1 is a straight line, higher is harder to test. R functions only.

Call graph figures
R functions
63
Calls
77
Unconnected
12
Groups
2
Growth (28 releases)
Total lines by release
1,543 on 24 Jan 20185,615 on 19 Jun 2026
Release changes

The tests ran and coverage was measured.

Lines run by tests
7.4%
Expressions run by tests
8.6%
Test cases
14
Exports named in tests
9.1%
Coverage by file (13)
Coverage run
Lines counted
1,255
Lines the tests ran
93
Tests passed
Yes
Measured with
covr 3.6.5 on R 4.6.1
Test suite
Has tests
Yes
Test frameworks
testthat
Test cases
14
Lines of tests
423
Test lines per line of code
0.14
Exports documented
100%
Arguments documented
100%
Return value documented
57.6%
Help pages with examples
89.5%
Examples run in checks
14.7%
Guides (8)
Other documentation
README
Yes, 1,320 words
Release notes file
Yes
Help pages
38
Lines of documentation
1,276
DatasetSizeColumns
CODES_TABLEA dataset with code table summaries for census data65 × 3geography, status_code, status
COV_SKYTRAIN_STATIONSA dataset City of Vancouver skytrain station locations22 × 3station, geo_local_area, geometry

mountainMath / cancensus on github.com

Stars
90no change on 30 days ago
Forks
14
Open issues
6
Last commit
16 Jul 2026
Activity
Commits
633
Open pull requests
0
Tagged releases
16
Latest tagged release
v0.6.1, 16 Jul 2026
Issues closed in
38 days (median)
Pull requests closed in
1 day (median)
Pull requests merged
89%
Created
28 Jul 2017
Licence file reads as
–
Development practices (8)
KindFound
Continuous integrationGitHub Actions, R CMD check workflow, Travis CI (config file)
The R CMD check workflow runs on Linux, macOS and Windows
Docs sourcepkgdown
GitHub Pages site last deployed 2026-07-16
pkgdown site last built 2026-06-17, before release 0.6.1 (2026-06-19)
Reproducibility and dev environmentdata-raw/
CRAN release processcran-comments.md
Lint, format, editorRStudio project

Method, repository practices

Across mountainMath

Claude Codeat least 15 crediting itClaude CodeFirst seen 11 Nov 2025at least 15 crediting it
Claude Sonnet 4.6Claude Sonnet 4.611 Jun 20261 commit
Claude Fable 5Claude Fable 511 Jun 20268 commits

Tools

ToolFirst seenFoundCommits crediting it
Claude Code11 Nov 2025Named in .Rbuildignore.claudePull request it wrote: opened by a project member15 at least
  • Named in .Rbuildignore
  • Pull request

Models

ModelCommitsFirst commitLast commitCredit lines of
Claude Sonnet 4.6111 Jun 202611 Jun 2026Claude Code
Claude Fable 5811 Jun 202611 Jun 2026Claude Code

Across mountainMath

R releases
  • On CRAN
  • Archived
  • Release
0.2.00.30.4.00.5.00.6.1Archived and backArchived and backArchived and backArchived and back

Archived and back

ArchivedBackCRAN's reasonKind
4 Nov 20256 Nov 2025policy violation. On Internet accessPolicy
22 Oct 202130 Oct 2021repeated policy violation despite reminders. On Internet accessPolicy
VersionReleasedREvents
0.6.1 current19 Jun 20264.6.0
0.6.014 Apr 20264.5.3
0.5.106 Nov 20254.5.2Back on CRAN 6 Nov 2025
0.5.710 Feb 20244.3.2Archived 4 Nov 2025
“policy violation. On Internet access”
0.5.64 Oct 20234.3.1
0.5.523 Jan 20234.2.2
0.5.47 Nov 20224.2.2
0.5.325 Aug 20224.2.1
Earlier versions (20)
VersionReleasedREvents
0.5.219 Aug 20224.2.1
0.5.08 Feb 20224.1.2
0.4.830 Oct 20214.1.1Back on CRAN 30 Oct 2021
0.4.722 Oct 20214.1.1Archived 22 Oct 2021
“repeated policy violation despite reminders. On Internet access”
0.4.621 Oct 20214.1.1
0.4.520 Oct 20214.1.1
0.4.419 Oct 20214.1.1
0.4.38 Jun 20214.1.0
0.4.29 Feb 20214.0.3
0.4.127 Jan 20214.0.3
0.4.016 Jan 20214.0.3
0.3.216 Jul 20204.0.2
0.3.123 Jun 20204.0.0
0.322 Jun 20204.0.0
0.2.212 May 20204.0.0
0.2.15 Mar 20203.6.3
0.2.028 Jul 20193.6.1
0.1.820 Nov 20183.5.0
0.1.74 Feb 20183.4.3
0.1.624 Jan 20183.4.3
Release notes (0.6.1)

Bug fixes

  • set_cancensus_api_key() and set_cancensus_cache_path() with overwrite = TRUE, install = TRUE no longer truncate the user's .Renviron when it does not already contain the corresponding key
  • get_statcan_wds_data() no longer caches error response bodies as data, and refresh = TRUE now bypasses the data cache as documented
  • remove_recalled_cached_data() no longer over-matches recalled vector IDs (e.g. a recall of v_CA21_1 no longer also flags cached data for v_CA21_10)
  • get_census() now warns about recalled data when reading tabular data from the local cache, matching the geometry path
  • parent_census_vectors() and child_census_vectors() now stop with "Unable to determine dataset" for mixed-dataset input instead of silently dropping vectors
  • find_census_vectors() exact search now matches queries containing regex metacharacters (e.g. "income ($)") literally instead of erroring or silently failing
  • find_census_vectors() semantic search now considers the best match for every query word (previously only the full phrase), and restores suffix n-grams dropped in 0.6.0
  • find_census_vectors() keyword search no longer matches every vector when the query starts with a digit or punctuation
  • visualize_vector_hierarchy() accepts multi-vector character input as documented, and no longer labels nodes truncated by max_depth as leaves (now marked with ...)
  • add_unique_names_to_region_list() now correctly preserves grouping of grouped input
  • list_census_datasets() and list_census_regions() staleness warnings now respect quiet = TRUE
  • API retry logic now retries HTTP 429 (rate limit) and 408 (timeout) responses, honoring Retry-After headers
  • The cache directory is now created recursively with a clear error on failure

Performance improvements

  • New in-memory session cache for list_census_vectors() and list_census_regions(): repeated calls within a session no longer re-read and deserialize the cached file on every access (cache hits are ~1000x faster)
  • parent_census_vectors() and child_census_vectors() use a hash-based BFS traversal, 4-8x faster on deep hierarchies on top of the 0.6.0 improvements, with identical output
  • find_census_vectors() semantic search prunes fuzzy-match candidates by length bound before computing Levenshtein distances
  • get_census() no longer scans the package library (installed.packages()) on spatial calls
  • get_statcan_wds_metadata() parent ID extraction is vectorized (~5-10x faster metadata parsing for large levels such as DA)

Minor changes

  • update links to refreshed CensusMapper