Block Assignment Files

Download and read US Census Bureau data relationship files. Provides support for cleaning and using block assignment files since 2010, as described in < https://www.census.gov/geographies/reference-files/time-series/geo/block-assignment-files.html>. Also includes support for working with block equivalency files, used for years outside of decennial census years.


baf

R-CMD-check baf statusbadge

The goal of baf is to provide lightweight block assignment (and equivalence) files from the US Census Bureau.

Installation

You can install the development version of baf like so:

pak::pak('christopherkenny/baf')

Example

The workhorse function for baf is the baf() function.

library(baf)

baf(state = 'NM', year = 2024, geographies = 'cd')
#> $CD118
#> # A tibble: 107,215 × 2
#>    GEOID           CDFP 
#>    <chr>           <chr>
#>  1 350010001071000 01   
#>  2 350010001071001 01   
#>  3 350010001071002 01   
#>  4 350010001071003 01   
#>  5 350010001071004 01   
#>  6 350010001071005 01   
#>  7 350010001071006 01   
#>  8 350010001071007 01   
#>  9 350010001071008 01   
#> 10 350010001071009 01   
#> # ℹ 107,205 more rows

Cache

By default, baf loads files to a temporary directory. To retain files across sessions, set the cache_to argument to a directory of your choosing. You can also set options(baf.use_cache = TRUE) to create a user-level cache that can persist across projects.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("baf")

0.0.4 by Christopher T. Kenny, a year ago


http://christophertkenny.com/baf/, https://github.com/christopherkenny/baf


Browse source code at https://github.com/cran/baf


Authors: Christopher T. Kenny [aut, cre] (ORCID: , Cory McCartan [ctb]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cli, curl, dplyr, fs, glue, readr

Suggests testthat


Imported by geomander, redistverse.


See at CRAN