Nonprofit-Open-Data-Collective / np-density-dashboard

R code for creating a dashboard representing nonprofit formation and location patterns.
1 stars 0 forks source link

dorling cartograms #1

Open lecy opened 2 years ago

lecy commented 2 years ago

Here is a repo with cartograms for all metro areas:

https://github.com/DS4PS/usa-dorling-shapefiles

You can grab metro maps from the library and load as follows:

https://github.com/DS4PS/usa-dorling-shapefiles/tree/master/maps/metros-dorling

library( geojsonio )   # read shapefiles
library( sp )          # work with shapefiles
library( sf )          # work with shapefiles - simple features format

# dorling cartogram of Phoenix Census Tracts
github.url <- "https://raw.githubusercontent.com/DS4PS/cpp-529-master/master/data/phx_dorling.geojson"
phx <- geojson_read( x=github.url,  what="sp" )
plot( phx )