MyNixOS website logo
Description

Access, Retrieve, and Work with CMHC Data.

Wrapper around the Canadian Mortgage and Housing Corporation (CMHC) web interface. It enables programmatic and reproducible access to a wide variety of housing data from CMHC.

cmhc

R-CMD-check CRAN_Status_Badge CRAN_Downloads_Badge

API wrapper for extracting CMHC data out of the CMHC Housing Market Information Portal.

Reference

Documentation is available on the GitHub pages.

The example vignettes contain some common use cases.

Installation

The stable version of cmhc can be easily installed from CRAN.

install.packages("cmhc")

Alternatively, the latest development version can be installed from Github.

remotes::install_github("mountainmath/cmhc")

Usage

Consult the example vignette for more information. As an example, this is how to extract time series information for vacancy rate data by bedroom type for the Vancouver Census Metropolitan Area ("59933").

library(cmhc)
vacancy_data <- get_cmhc(survey="Rms",series="Vacancy Rate",dimension="Bedroom Type",
                         breakdown="Historical Time Periods",  geo_uid="59933")

Starting with version v.0.3.2 the package has an interactive query builder helper function select_cmhc_table() that interactively walks through the available data and builds parameters for get_cmhc() like the example above. This makes it easy to discover data and build function calls to CMHC tables.

Contributing

  • We encourage contributions to improve this project. The best way is through issues and pull requests.
  • If you want to get in touch, we are pretty good at responding via email or via twitter at @vb_jens.

Cite cmhc

If you wish to cite cmhc:

von Bergmann, J. cmhc: R package to access, retrieve, and work with CMHC data. v0.2.8.

A BibTeX entry for LaTeX users is

  @Manual{cmhc,
    author = {Jens {von Bergmann}},
    title = {cmhc: R package to access, retrieve, and work with CMHC data},
    year = {2024},
    note = {R package version 0.2.8},
    url = {https://mountainmath.github.io/cmhc/},
  }

Related packages

The cmhc package is designed to work well with the cancensus package working with Canadian Census data the cansim package for regular StatCan tables, and matches the census geographies via a GeoUID column that is shared across these packages. The tongfen package facilitates making geographies from different census years that CMHC reports on comparable over time.

CMHC Attribution

Subject to the CMHC Data License Agreement, licensed products using CMHC data should employ the following acknowledgement of source:

Acknowledgment of Source

a. You shall include the following notice on all reproductions of the Information:

Source: Canada Mortgage and Housing Corporation (CMHC), name of product or information, reference date. This information is reproduced and distributed on an “as is” basis with the permission of CMHC.

b. Where any Information is contained within a Value-added Product, you shall include on such Value-added Product the following notice:

Adapted from Canada Mortgage and Housing Corporation, name of product or information, reference date. This does not constitute an endorsement by Canada Mortgage and Housing Corporation of this product. or any other notice approved in advance in writing by CMHC.

Metadata

Version

0.2.8

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows