ACS Data Users Group

 View Only
  • 1.  tmap, tidycensus, and choropleth maps for places (cities)

    Posted 02-27-2024 02:12 PM

    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


  • 2.  RE: tmap, tidycensus, and choropleth maps for places (cities)

    Posted 02-27-2024 02:28 PM

    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.



  • 3.  RE: tmap, tidycensus, and choropleth maps for places (cities)

    Posted 02-27-2024 02:56 PM

    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.