Closed arilamstein closed 6 years ago
Yes, censusapi supports the ACS subject tables. There are two issues with the code above - you need to use the correct endpoint name
and retrieve a valid list of vars
and/or a variable group. The endpoint names can be found by running apis <- listCensusApis()
and searching for the ACS subject tables - in this case you want acs/acs5/subject
.
S1902
is a group/table name, not a variable name. You can retrieve that group of variables in censusapi, but need to specify that it is a group. The full code is:
getCensus(name = "acs/acs5/subject",
vintage = 2016,
vars = "group(S1902)",
region = "state:26")
I recommend checking out the intro tutorial for how to find a dataset name and variable metadata.
Does censusapi support getting acs subject tables? For example, I have a client who would like to import all data in table S1902 for the state of Michigan into R. You can see the data in American Fact Finder here: https://factfinder.census.gov/faces/tableservices/jsf/pages/productview.xhtml?pid=ACS_16_5YR_S2703&prodType=table.
I wasn't sure if censusapi supports importing subject tables. I wrote this code, attempting to import all the data in the above AFF page into R:
I got this error
Any advice would be appreciated.