hrecht / censusapi

R package to retrieve U.S. Census data and metadata via API
https://www.hrecht.com/censusapi/
169 stars 31 forks source link

Add ability to include miscellaneous parameters #49

Closed RSchwinn closed 5 years ago

RSchwinn commented 5 years ago

Thanks for your great package! Would it be possible to add miscellaneous parameters to API requests? The county business patterns requires additional comments in order to report data by employment size. See example below:

hrecht commented 5 years ago

Yes, hoping to add that in the next version of this package!

hrecht commented 5 years ago

Done, in v0.6.0 https://github.com/hrecht/censusapi/commit/a5f0edb8081c428e7ae092065b3c39a408f3869d It's not on CRAN yet, but can be installed with:

# install.packages("devtools")
devtools::install_github("hrecht/censusapi")

Here's an example using EMPSZES:

cbp_2008 <- getCensus(name = "cbp",
  vintage = 2008,
  vars = c("YEAR", "EMPSZES_TTL", "EMP", "ESTAB", "PAYANN", "GEO_TTL"),
  region = "state:*",
  EMPSZES = 260)
head(cbp_2008)