Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open URL? #25

Open
BryanSWeber opened this issue Feb 6, 2023 · 3 comments
Open

Cannot open URL? #25

BryanSWeber opened this issue Feb 6, 2023 · 3 comments

Comments

@BryanSWeber
Copy link

BryanSWeber commented Feb 6, 2023

So I am attempting to download several ACS for various specific regions and years, and have came up with the call:
Where uniquePlaces is a DF of [cityName, StateAbb]. I am trying to avoid downloading everything in the ACS for all years for obvious reasons - but the calls tend to go to URLs that don't exist.

> acsStored<-read_acs1year(year = 2015,
+               states = unique(uniquePlaces[,2]),
+               areas= paste0(uniquePlaces[,1], " city,", uniquePlaces[,2]),
+               table_contents = c( "income = B19013_001") ) 

Do you want to download 2015 ACS 1-year survey summary files of states NA, AK, KS, ID, IA, CT, NY, NV, SC, LA, PA, MD, MO, OR, NC, OK, NM, OH, MN, NJ, MA, MI, MT, NE, MS, ME, RI, NH, ND, WI, TX, TN, WA, UT, VA, VT, SD, WV, WY and save it to your computer? It is necessary for extracting the data.
1: yes
2: no

Selection: 1
Downloading 1 of 39 states.
Downloading NA summary files of ACS 1-year of 2015.
trying URL 'https://www2.census.gov/programs-surveys/acs/summary_file/2015/data/1_year_by_state/_All_Geographies.zip'
Error in download.file(url, save_as, method = "auto") :
cannot open URL 'https://www2.census.gov/programs-surveys/acs/summary_file/2015/data/1_year_by_state/_All_Geographies.zip'

How do I circumvent this error or continue downloading whatever is possible?

@GL-Li
Copy link
Owner

GL-Li commented Feb 7, 2023

Looks like you have missing state in unique(uniquePlaces[,2])

@BryanSWeber
Copy link
Author

BryanSWeber commented Feb 7, 2023

Ah! Good point. I replaced it with the base R object state.abb and it now runs happily.
I run into a bug as I move up the year count, though:

read_acs1year(year = 2020,
              states = state.abb, #All states using a base built-in
              summary_level = 'place',
              table_contents = c( "income = B19013_001") )

It runs into a problem with the 2020 data for Alabama - 

Do you want to download 2020 ACS 1-year survey summary files of states AL, AK, AZ, AR, CA, CO, CT, DE, FL, GA, HI, ID, IL, IN, IA, KS, KY, LA, ME, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY and save it to your computer? It is necessary for extracting the data.
1: yes
2: no

Selection: 1
Downloading 1 of 50 states.
Downloading AL summary files of ACS 1-year of 2020.
trying URL 'https://www2.census.gov/programs-surveys/acs/summary_file/2020/data/1_year_by_state/Alabama_All_Geographies.zip'
Error in download.file(url, save_as, method = "auto") : 
  cannot open URL 'https://www2.census.gov/programs-surveys/acs/summary_file/2020/data/1_year_by_state/Alabama_All_Geographies.zip'
In addition: Warning messages:
1: In download.file(url, save_as, method = "auto") :
  downloaded length 0 != reported length 18282
2: In download.file(url, save_as, method = "auto") :
  cannot open URL 'https://www2.census.gov/programs-surveys/acs/summary_file/2020/data/1_year_by_state/Alabama_All_Geographies.zip': HTTP status was '404 Not Found'

Is there a point where the data isn't available, perhaps?

@GL-Li
Copy link
Owner

GL-Li commented Feb 9, 2023

No 2020 1-year ACS data due to COVID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants