I have found this to work and to be much simpler than using a temporary file:
u <- "https://mgimond.github.io/ES218/Data/ACS.rds"
data <- readRDS(url(u, method="libcurl"))
You can see this has properly read in the data since:
> names(data)
[1] "County" "State" "B19013001" "B19013001s" "B23006001"
[6] "B23006002" "B23006003" "B23006004" "B23006005" "B23006006"
[11] "B23006007" "B23006008" "B23006009" "B23006010" "B23006011"
[16] "B23006012" "B23006013" "B23006014" "B23006015" "B23006016"
[21] "B23006017" "B23006018" "B23006019" "B23006020" "B23006021"
[26] "B23006022" "B23006023" "B23006024" "B23006025" "B23006026"
[31] "B23006027" "B23006028" "B23006029" "B23006001s" "B23006002s"
[36] "B23006003s" "B23006004s" "B23006005s" "B23006006s" "B23006007s"
[41] "B23006008s" "B23006009s" "B23006010s" "B23006011s" "B23006012s"
[46] "B23006013s" "B23006014s" "B23006015s" "B23006016s" "B23006017s"
[51] "B23006018s" "B23006019s" "B23006020s" "B23006021s" "B23006022s"
[56] "B23006023s" "B23006024s" "B23006025s" "B23006026s" "B23006027s"
[61] "B23006028s" "B23006029s"
I do see that this seems to be the American Community Survey. The Census has an API that allows you to access this data directly through their API. You may want to explore that here: https://www.census.gov/data/developers/data-sets.html.
The tidycensus package in R
offers direct access to the American Community Survey via the Census API as well. For example, after registering for a Census API key, the following code would allow you to access the 2017 ACS-1 data from Table DP05:
library(readr)
library(tidyverse)
library(tidycensus)
#Get census API key at: https://api.census.gov/data/key_signup.html
census_api_key("insert your API key here")
#Get Age Data from 2017 ACS-1 Survey; includes DC and Puerto Rico
DP052017 <- get_acs(geography = "state", year = 2017, table = "DP05",
cache_table = TRUE, survey = "acs1")
head(DP052017)
head(DP052017)
# A tibble: 6 x 5
GEOID NAME variable estimate moe
<chr> <chr> <chr> <dbl> <dbl>
1 01 Alabama DP05_0001 4874747 NA
2 01 Alabama DP05_0001P 4874747 NA
3 01 Alabama DP05_0002 2359896 5397
4 01 Alabama DP05_0002P 48.4 0.1
5 01 Alabama DP05_0003 2514851 5397
6 01 Alabama DP05_0003P 51.6 0.1