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

Feature request: Lookup table for data_code_type #62

Closed zmeers closed 4 years ago

zmeers commented 4 years ago

Hi, fantastic package here! I use it a lot. I have a request: would it be possible to add information about the column data_code_type for time series data? For example, I am grabbing the Major Retail Time Series data set by running the following code:

retail_trade_us <- getCensus(name ="timeseries/eits/mrts", 
                             vars = c(us_vars$name), #where us_vars is just the metadata info from `listCensusMetadata`
    type = "variables")
                             time = "from 1992 to 2020",
                             key = Sys.getenv("CENSUS_KEY"))

Among other columns, it returns the column data_code_type. For the above survey, the unique values are:

list(unique(retail_trade_us$data_type_code))
[[1]]
 [1] "E_SM"    "IR"      "MPCSM"   "E_IR"    "E_MPCIM" "E_MPCSM" "E_IM"    "MPCIM"   "SM"     
[10] "IM" 

The only problem is I have no idea what this refers to! I can't find a reference on the US Census API page or in the R package anywhere. Is this information easily accessible?

If this is within the scope of the package, I'd greatly appreciate any further clarification.

Thanks, Zoe

hrecht commented 4 years ago

Hi Zoe, those codes are created by the Census Bureau. The R package is just returning what's in the data. Your best bet for documentation is to ask them directly, unfortunately it's not in the scope of this package. Best of luck.