MyNixOS website logo
Description

Making Census Data More Usable.

Creates a common framework for organizing, naming, and gathering population, age, race, and ethnicity data from the Census Bureau. Accesses the API <https://www.census.gov/data/developers/data-sets.html>. Provides tools for adding information to existing data to line up with Census data.

censable

R-CMD-check Lifecycle:stable CRANstatus CRAN downloads

censable wraps censusapi for common requests, with memoized data functions. With a growing redistricting universe in R, it seems right to partition out some use cases, to allow imports to be more targeted and to stop packages from repeating each other.

Installation

You can install the released version of censable from CRAN with:

install.packages("censable")

You can download the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("christopherkenny/censable")

Example

library(censable)

The primary data functions are build_dec and build_acs

de <- build_dec(geography = 'county', state = 'DE')

The build_* functions take arguments on geography and state, at a minimum. If you’re looking at a smaller piece of a state, you can use county to subset it. Year defaults to 2010, but will be updated to 2020 around October 2021, following the API release of the 2020 Census data.

The build_* functions are a convenient wrapper around censusapi, with an eye towards collecting data on total population and voting age population by race. Total population variables begin with the prefix pop, while voting age population variables begin with the prefix vap.

Additionally, there are memoised versions of the build_* functions:

de <- mem_build_dec(geography = 'county', state = 'DE')

These speed up repeated calls, allowing you to have code that is self contained and reproducible, without taking the time hit of having to re-download the data each time.

Metadata

Version

0.0.5

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