tmap, tidycensus, and choropleth maps for places (cities)

Greetings,

I have select data at the city/place level (not tracts, ZCTAs, etc.), just attribute/variable per city.

I have pulled the places shapefile from tigris and merged the two files and attempted to plot them in R (e.g., using tmap, ggplot2).

However, the geometry information in the places file does not appear to be recognized and I get the following error message: 

File is neither from class sf, stars, Spatial, Raster, nor SpatRaster.

What are alternate ways of getting an appropriate shape file for places or of creating a choropleth map for them?

Thanks,
Saul
  • I think you should try to go with `geometry=TRUE` argument in `get_acs()` so that `tidycensus` has proper internal way of dealing with these shapefiles.

  • Typically, I would save this data is not from the ACS or using get_acs. It is other administrative data that only contains one line per city/place. This is why I downloaded and merged it with the places file from tigris, which contains lat, lon, and a geometry column, but alas I have not been able to produce a choropleth map of it yet.