New R user here looking for help with a get_data pull from TidyCensus. I’m looking to pull data on a small unit for a specific city, rather than to a county or state. For example tract data for the city of Pittsburgh or Block Group data for just Miami.
Currently, I can pull data by unit for counties or state, but then I’m not sure how to filter this to a specific city. My code below finds tracts at the larger county-based area rather than just the city.
Miami <- get_decennial(
geography = “tract”,
variables = "P2_001N",
state = "FL",
county = c("Miami-Dade", "Broward", "Palm Beach"),
geometry = TRUE,
year = 2020
)
Another way is that I can pull data for an urban area or an MSA but then the data is aggregated to that level rather than the tract or Black Group. At this stage, I’m not fussy on the city boundaries. Urban areas, MSA, CBSA would be fine as long as I can get data at the block, block group, or tract level for this city area.
Any suggestions are absolutely helpful!