Hello! First time poster, so please be gentle. I'm relatively new to unaggregated Census data, although have a solid knowledge of R, statistics, and (if dated) survey methods.
I have spend a few hours over the long weekend trying to familiarize myself with tidycensus, PUMS data, and IPUMS/ipumsr. tidycensus seems as if it should work, but I'm getting an error message:
Error in curl::curl_fetch_memory(url, handle = handle) : Could not resolve host: api.census.gov
I don't know if it's related; I have tried to approaches to entering my key:
tidycensus::census_api_key(key = "l0ts0fl3tt3r2andnumb3r2", install = TRUE)
temp <- get_pums(
variables = c("NRC", "FES", "WGTP"),
state = "AR",
survey = "acs1",
year = 2019,
rep_weights = "housing",
key = "l0ts0fl3tt3r2andnumb3r2",
show_call = TRUE
)
Ultimately, what I'm really trying to get is best represented by the following SQL pseudocod (although I could recode/rebucket the continuous NRC data):
SELECT NRC, FES, A_WGT_FACTOR -- number of children, adult gender/labor force, an appropriate weighting factor
FROM PUMS_DB -- the appropriate PUMS data source
WHERE SURVEY_YR = '2019'
AND SURVEY_SOURCE = 'ACS1'
GROUP BY STATE
ORDER BY STATE DESC
Unless I misunderstand, I would have to download, unzip and then upload all the files to a database in order to execute the query above (?).
Any tips, tricks or hints would be most appreciated. Thanks in advance and regards, T
Glad you got it working! I've had to play around with my proxy settings at work to have R get around my firewall. Under the hood, tidycensus is using httr/curl to make the API request, so you might try looking at those settings -- here is some useful discussion of different options:
stackoverflow.com/.../proxy-setting-for-r