hrecht / censusapi

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

Update getcensus_functions.R responseRaw string column parts #77

Closed wesnm closed 2 years ago

wesnm commented 2 years ago

Several variables in timeseries/intltrade/imports have numerals in their names, but are not numeric data. Adding "UNIT_QY" (a quantity unit of measure field) and "_FLAG" (a flag field) to string_col_parts account for these fields prevents NA from the numeric conversion.

See: https://api.census.gov/data/timeseries/intltrade/imports/hs/variables.html

hrecht commented 2 years ago

Thanks for raising this issue. I'll need to fix it a little bit differently to avoid issues with other APIs so will be rejecting this pull request, but will fix in the new development version.

hrecht commented 2 years ago

Addressed here, please try out the dev version and let me know if it works or if you run into issues. You can get the dev version with:

# install.packages("devtools")
devtools::install_github("hrecht/censusapi")
wesnm commented 2 years ago

Appears to be working, at least the datasets that I was having issues with.