The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Title: Block Assignment Files
Version: 0.0.1
Description: 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.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.1
Imports: cli, curl, dplyr, fs, glue, readr
URL: http://christophertkenny.com/baf/, https://github.com/christopherkenny/baf
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2024-06-03 20:19:17 UTC; chris
Author: Christopher T. Kenny ORCID iD [aut, cre], Cory McCartan ORCID iD [ctb]
Maintainer: Christopher T. Kenny <christopherkenny@fas.harvard.edu>
Repository: CRAN
Date/Publication: 2024-06-04 16:00:06 UTC

baf: Block Assignment Files

Description

logo

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.

Author(s)

Maintainer: Christopher T. Kenny christopherkenny@fas.harvard.edu (ORCID)

Other contributors:

See Also

Useful links:


Download Block Assignment Files (BAF) from the Census Bureau

Description

Download Block Assignment Files (BAF) from the Census Bureau

Usage

baf(
  state,
  year = 2020,
  geographies = NULL,
  cache_to = baf_download_path(),
  overwrite = FALSE
)

Arguments

state

state to download data for.

year

year to download data for. Default is 2020.

geographies

geography types to download. Default is NULL, which gets all available geographies.

cache_to

directory name to save the downloaded data. Default is baf_download_path().

overwrite

Should the data be re-downloaded? Default is FALSE.

Value

a list of tibbles for each geography type

Examples

baf('DE', 2020)

Download a file

Description

Download a file

Usage

baf_download(url, path, overwrite = FALSE, quiet = FALSE)

Arguments

url

a URL

path

a file path

overwrite

should the file at path be overwritten if it already exists? Default is FALSE.

quiet

should output and progress bar be suppressed?

Value

a path to the downloaded file, invisibly

Examples

tf <- tempfile(fileext = '.zip')
ex <- 'https://www2.census.gov/geo/docs/maps-data/data/baf2020/BlockAssign_ST01_AL.zip'
baf_download(url = ex, path = tf)

Get download location for baf files

Description

Get download location for baf files

Usage

baf_download_path()

Value

a path

Examples

baf_download_path()

Clean Block Assignment Files

Description

Clean Block Assignment Files

Usage

clean_bafs(bafs, state = NULL)

Arguments

bafs

list of block assignment files, named by type

state

if provided, adds the first two digits of the state FIPS to each code

Value

a tibble with two columns

Examples

baf('WA') |> clean_bafs('WA')

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.