Questions tagged [tidycensus]
84 questions
1
vote
1 answer
tidycensus with map_dfr, years coming in as 1:12 rather than 2009:2020
I am using map_dfr to loop through a few years when pulling ACS data using TidyCensus. However, the years column it generates has values 1:12 instead of the actual year. I don't want to relabel them manually, because I may pick other years in the…

tchoup
- 971
- 4
- 11
1
vote
2 answers
tidy way to load tidycensus variables (decennial)
I am using tidycensus to read in some census data. I am starting with loading the variables, and the way I am doing it just feels really clunky. Any advice on a cleaner way to code the load variable bit, so I don't load sf1, sf2, sf3 and sf4 in…

tchoup
- 971
- 4
- 11
1
vote
0 answers
Join to get coverage on movil network operators at a state level
fdb is this file and I need to join it with number of HHs by block group but it's not working as Geeks for Geeks says it will because the number of census blocks (12 first in BlockCode) at the end isn't as many after merging as it says it is at the…

MelaniaCB
- 427
- 5
- 16
1
vote
2 answers
Change the size layout in ggiraph package
In this example below from (from https://walker-data.com/census-r/mapping-census-data-with-r.html#linking-maps-and-charts), i would like to increase the width of the map. How can i do…

Meo
- 140
- 1
- 9
1
vote
0 answers
get_decennial() returns error for 2020 data?
I've been working with census data from 2000, 2010, and 2020 for a local geography. My pulls for 2000 and 2010 work with no problem, but I get an error when I try to pull 2020 data.
vars = c("P001001", #Total population
"H013001", #Total…

Nissim
- 11
- 1
1
vote
1 answer
Remove the outer boundary of the US using tidycensus, sf, and/or tmap packages
I downloaded the polygons for the contiguous United States from the tidycensus package. However, due to mapping needs, I would like to remove the outline of the US from the polygon, leaving the internal state borders only. Here is my…

z_11122
- 153
- 8
1
vote
1 answer
Can I map specific blocks using Tidycensus and Tigris?
I'm trying to map data for four blocks using R packages Tidycensus and Tigris. I wonder if it possible to specify the blocks you want to map, or if one must map the entire County? Could I add a line to the above code to specify the blocks I want to…

Abrina Williams
- 11
- 1
1
vote
2 answers
Capturing the range indicated by the use of "to" in a column - tidycensus (U.S. Census API)
How might I capture all the years of age in a column with values like "20 to 24 years" for one group and "22 to 24 years" for another group? This will enable me to confirm I have all the working age (18-64) variable names captured in a tidycensus (R…

Rick Pack
- 1,044
- 10
- 20
1
vote
0 answers
get_acs not pulling tract geography for Wilson County in Texas in 2009?
The following code seems to be missing geography information for tracts in Wilson County in Texas for 2009 using the 5-year ACS. Any ideas of what could be wrong?
racedat09 <- get_acs(geography = "tract",
state = "TX",
…

Calo
- 45
- 6
1
vote
1 answer
Why am I unable to build data frame with census block and lat/long outline?
I am new to R and working with census data and I am trying to build a csv file that can be passed to another team that shows the lat/long outline of census blocks.
With this I can get to 3 specific census blocks in Florida.
FL_blocks <- blocks("FL",…

MJ_215
- 13
- 2
1
vote
1 answer
ACS 1 and 5-year block groups in tidycensus
Is block group level data available for the ACS 5-year survey before 2013 through the tidycensus R package? I am trying to collect consecutive years of population data for Gettysburg, PA, but I keep getting an error that block group level is an…

wellma01
- 11
- 1
1
vote
2 answers
How to calculate the area of a geospatial ZIP code polygon extracted from the US Census using tidycensus
I would like to calculate the population density for ZIP codes in my state (North Carolina). I am able to extract the ZIP code populations and polygons from the US Census and plot the map of North Carolina using the following…

Brant Inman
- 53
- 3
1
vote
1 answer
Tidycensus - One year ACS for All Counties in a State
Pretty simple problem, I think, but not sure of the proper solution. Have done some research on this and think I recall seeing a solution somewhere, but cannot remember where...anyway,
Want to get DP03, one-year acs data for all Ohio counties, year…

James Crumpler
- 192
- 1
- 8
1
vote
0 answers
get_acs() fails to get data from 2012 or prior surveys when pulling Census Block Groups
I have some code (below) which runs fine for getting census block group data for a certain geo (Atlanta as example below) for ACS surveys 2013/14/15/16/17. however when I run it for 2012 or prior i get the following error.
Getting data from the…

NoNameMLer
- 21
- 5
1
vote
0 answers
R - Add Tigris SF Shapefile to ggmap
I am trying to add shapefiles on top of a ggmap object. Specifically, I would like to use Simple Feature (SF) shapefiles downloaded from the R package Tigris. I have tried to overlay these on Stamen and Google Maps from ggmap.
Packages…

Chris Kiniry
- 499
- 3
- 13