Open Dimetry-Adel opened 1 year ago
Hi @Dimetry-Adel I looked at your code again and I realized the issue is not with your county filtration it's your step these.msp <- crosswalk$msaname == "OHIO"
You will need to identify a metro area in Ohio [example Columbus, Cincinnatti, Cleveland, etc.] and then work from there. Then your county filter should work within the get_acs pull
Thank you, It worked.
Hello @castower I am trying to call population data from US Census Bureau. Although, it worked with Lab04 CPP-529 I have got these two errors:
1
2
These are my codes: ` census_api_key("key(long)", install = TRUE)
these.msp <- crosswalk$msaname == "OHIO" these.fips <- crosswalk$fipscounty[ these.msp ] these.fips <- na.omit( these.fips )
state.fips <- substr( these.fips, 1, 2 ) county.fips <- substr( these.fips, 3, 5 )
msp.pop1 <- get_acs( geography = "tract", variables = "B01003_001", state = "39", county = county.fips[state.fips=="39"], geometry = TRUE ) %>% select( GEOID, estimate ) %>% rename( POP=estimate )
msp.pop2 <- get_acs( geography = "tract", variables = "B01003_001", state = "48", county = county.fips[state.fips=="48"], geometry = TRUE ) %>% select( GEOID, estimate ) %>% rename( POP=estimate )
msp.pop <- rbind( msp.pop1, msp.pop2 ) `
Could you please advise me? Thanks in advance