Skip to content

Scales, Palettes, and Extensions of 'ggplot2' for Redistricting

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

alarm-redist/ggredist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d2ebbfe · Jun 27, 2024

History

81 Commits
Aug 15, 2023
Jun 27, 2024
Aug 27, 2022
Jul 25, 2022
Jun 13, 2024
Oct 23, 2022
Jun 23, 2022
Feb 3, 2023
Jun 13, 2024
Jun 20, 2022
Jun 20, 2022
Jun 27, 2024
Jun 13, 2024
Dec 30, 2023
Dec 30, 2023
Jun 23, 2022
Nov 17, 2022
Jun 30, 2022

Repository files navigation

ggredist

R-CMD-check r-universe status badge

ggredist provides ggplot2 extensions for political mapmaking, including new geometries, easy label generation and placement, automatic map coloring, and map scales, palettes, and themes.

Here’s an example of what you can do with the package.

library(ggredist)
library(ggplot2)

data(oregon)

ggplot(oregon, aes(group=cd_2020)) +
  # 'ndv' and 'nrv' contain D and R vote counts
  geom_district(aes(fill=ndv, denom=ndv+nrv), linewidth=0.9) +
  geom_district_text() +
  # can then highlight towns and cities
  geom_places(state = 'OR') + 
  # we can overlay county boundaries and labels
  geom_district(aes(group=county), linewidth=0.2, linetype="dashed", fill=NA) +
  geom_district_text(aes(group=county, label=toupper(county)),
                     size=2.2, check_overlap=TRUE) +
  scale_fill_party_b(limits=c(0.4, 0.6)) +
  theme_map()

See more in the reference.

Installation

You can install the development version of ggredist from GitHub with:

# install.packages("remotes")
remotes::install_github("alarm-redist/ggredist")

About

Scales, Palettes, and Extensions of 'ggplot2' for Redistricting

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages