Description Usage Format Details Author(s) Examples
Congressional District (116th) Cartogram Shapefile
1 |
A dataframe with 435 rows and 6 variables, including:
District code. The formatting corresponds to the CCES cumulative
coding of cd
: a two-letter abbreviation for the state followed by
a dash, and the district number padded with zeros to the left to be of length
2. At-large districts like Delaware are given a "-01" for the district number.
The simple features (sf) column that wil be used for mapping
These shape files are directly downloaded from Daily Kos
in the link http://dkel.ec/map. It additionally adds minimal
formatting of the coordinate system to render properly in R's
sf
.
Daniel Donner http://dkel.ec/map
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(ggplot2)
library(ggthemes)
library(dplyr)
ggplot(cd_shp) + geom_sf() + theme_map()
library(dplyr)
cd_black <- left_join(cd_shp, race_by_cd, by = "cd") %>%
filter(race == "Black")
ggplot(cd_black) +
geom_sf(aes(fill = frac)) +
scale_fill_viridis_b("Percent Black") +
theme_map() +
labs(caption = "Map Source: http://dkel.ec/map")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.