Questions tagged [tidycensus]

84 questions
10
votes
2 answers

tidycensus::get_acs() geography options?

What are the possible levels/options for the geography argument in tidycensus::get_acs(geography = ???)? I've seen it work as follows: library(tidycensus) census_api_key("YOUR API KEY GOES HERE") vt <- get_acs(geography = "county", …
Chris Kiniry
  • 499
  • 3
  • 13
4
votes
1 answer

Why does geom_sf is not allowing fill with discrete column from a dataframe?

I drew a spatial map using geom_sf, however it is keep picking up a continuous scale for my fill parameter whenever it is inside of aes but when I take it out and fill in scale_fill_manual it is not working either, it is overriding my manual colors…
WannabeSmith
  • 435
  • 4
  • 18
4
votes
2 answers

Trouble with Loading Tidycensus data

I am trying to load variable data in with tidycensus but am running into a pervasive error. library(tidycensus) library(tidyverse) census_api_key("My key is here") poverty <- get_acs(geography = "block group", variables = "B17021", …
2
votes
0 answers

How acquire Census same-sex with children data - separate variables but reports include combo

I use the tidycensus R package all the time and cannot figure out how articles like this one used the Census 2019 1-year ACS estimates to produce stats like: "In 2019, 22.5% of female same-sex couple households had children under 18 present,…
Rick Pack
  • 1,044
  • 10
  • 20
2
votes
1 answer

Create a bivariate choropleth map using Tidycensus?

It is quite easy to create a choropleth using the tidycensus` R package as discussed in Kyle Walker's "Spatial Analysis with US Census Data". How might one create a bivariate choropleth using Kyle's tidycensus, which acquires Census data through the…
Rick Pack
  • 1,044
  • 10
  • 20
2
votes
0 answers

US census block group or county to MSAs relationships with R package

I am using the tidycensus package in R and am trying to match the US census 'block group' level data to the relevant metropolitan statistical area (MSA). I have the 'block group' to county relationship, but am trying to see if tidycensus or a…
qwertytam
  • 133
  • 9
2
votes
1 answer

How to solve tigris::call_geolocator() Internal Server Error (HTTP 500) error?

I wanted to get the Census Codes for a city from the addresses in my data. The problem is that I couldn't find workable shapefiles for Gainesville, FL. So I was trying to get the Census Codes using the addresses of the people who took the survey,…
CaseebRamos
  • 684
  • 3
  • 18
2
votes
0 answers

Using R to compare multiple 5-year ACS estimates in one geography

I'm comparing racial composition and area median income over time in one area (can do either census tract or ZCTA. Here I'll include ZCTA because the MOE isn't as large). What is the best format to put my data into so that I can visualize it? Also,…
Lizzie
  • 21
  • 3
2
votes
1 answer

How to remove lakes/water from maps in R

(I'll apologize in advance for not having a reprex. Can't get to work-going to be a separate question later today). I have pulled ZCTA level data from the US Census, rolled the ZCTAs into groups, and created a choropleth map. I would like to remove…
2
votes
2 answers

mutate several columns into a function creates a lists for each component inside the resulted column in dplyr

I have a function from a package(tidycensus), that I want to use it through the piping and mutate. I have created this simple mockup to show the situation. library(tidycensus) tt <- as_data_frame(matrix(1:36, ncol = 6)) colnames(tt) <- c("A", "B",…
BobbyF
  • 431
  • 1
  • 7
  • 19
2
votes
2 answers

Use purrr() to rather than lapply for arbitrary city/county pairs in tidycensus?

I've got a giant lapply running to download a file of data. But it seems clumsy. But mapply does not seem right, as I don't want all state/county combinations. I hear good things about map(). Can anyone furnish an example of how I might use purrr()…
Mox
  • 511
  • 5
  • 15
1
vote
2 answers

How to create a map using zip codes in R?

I'm trying to make a graph of California based on zip codes because I have some data that are based on them. I've tried excel-geography to plot but they only plotted a portion of zip codes with confidence. Recently, I learned a mapping package in R…
Yvonne
  • 15
  • 5
1
vote
1 answer

Error when using Tidycensus and map_dfr for "place" geographies

I'm using map_dfr to loop through multiple years of data for the "place" geography when pulling ACS data using TidyCensus. I'm following the template described here and here. I'm receiving the following error and I'm stuck on debugging it. Would…
Brian Root
  • 13
  • 2
1
vote
2 answers

How to get rid of the "Error in CPL_write_ogr" error when using "st_write" to export a sf object?

I'm trying to intersect two sf objects for the US (one at the township level and the other one at the census tract level). I'm getting both using tigris and tidycensys. My final goal is to have an unique sf object with information at the township…
1
vote
1 answer

R Tidy Census - Variable for Voters 18+

I have been trying to find a variable on the Tidy Census’ latest American Community Survey (ACS) variable list. The one I’m looking for would be for all voters aged 18 and up. I have yet to find it in the list. Even if I have to combine a couple…
Logan W.
  • 39
  • 5
1
2 3 4 5 6