U.S. 2020 Democratic Election WSJ Cartogram in R
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
boB Rudis ab85a38618
fig gg
pirms 4 gadiem
R fig gg pirms 4 gadiem
data-raw initial commit pirms 4 gadiem
inst/tinytest R package repo initialization complete pirms 4 gadiem
man fig gg pirms 4 gadiem
tests R package repo initialization complete pirms 4 gadiem
.Rbuildignore initial commit pirms 4 gadiem
.codecov.yml R package repo initialization complete pirms 4 gadiem
.gitignore R package repo initialization complete pirms 4 gadiem
.travis.yml R package repo initialization complete pirms 4 gadiem
CONDUCT.md R package repo initialization complete pirms 4 gadiem
DESCRIPTION separated out functions pirms 4 gadiem
LICENSE initial commit pirms 4 gadiem
LICENSE.md initial commit pirms 4 gadiem
NAMESPACE separated out functions pirms 4 gadiem
NEWS.md R package repo initialization complete pirms 4 gadiem
README.Rmd separated out functions pirms 4 gadiem
README.md fig gg pirms 4 gadiem
catchpole.Rproj R package repo initialization complete pirms 4 gadiem

README.md

Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped. Signedby Signed commit% Linux buildStatus
Minimal RVersion License

catchpole

2020 Democrat POTUS Delegate Map Tracker

Description

Tools to build a 2020 (D) delegate cartogram

CREDIT

The hard work was done by WSJ’s Brian McGill ([@brian_mcgill](https://twitter.com/brian_mcgill/)) who manually crafted the base cartogram over days then translated that into the beautiful and illuminating creation that is the WSJ online delegate tracker: https://www.wsj.com/graphics/elections/2020/track-the-delegate-count/.

Brians’s tweetnouncement: https://twitter.com/brian_mcgill/status/1222556373864648704?ref_src=twsrc%5Etfw

What’s Inside The Tin

The following functions are implemented:

  • delegates_map: Retrieves the delegates basemap
  • delegates_pal: WSJ palette for the candidates likely getting delegates
  • expand_candidates: Expand the state totals per delegate into an indexed data frame
  • gg_catchpole: Plot a U.S. Democratic Delegates Cartogram (2020)
  • read_delegates: Retrieves current U.S. State delegate assignments for 2020 from the WSJ

Installation

remotes::install_git("https://git.rud.is/hrbrmstr/catchpole.git")
# or
remotes::install_git("https://git.sr.ht/~hrbrmstr/catchpole")
# or
remotes::install_gitlab("hrbrmstr/catchpole")
# or
remotes::install_bitbucket("hrbrmstr/catchpole")
# or
remotes::install_github("hrbrmstr/catchpole")

NOTE: To use the ‘remotes’ install options you will need to have the {remotes} package installed.

Usage

library(catchpole)

# current version
packageVersion("catchpole")
## [1] '0.1.1'
library(sf)
library(catchpole) # hrbrmstr/catchpole
library(hrbrthemes)
library(tidyverse)

gg_catchpole() +
  theme_ft_rc(grid="") +
  theme(legend.position = "bottom")

catchpole Metrics

Lang # Files (%) LoC (%) Blank lines (%) # Lines (%)
R 8 0.89 78 0.84 28 0.58 44 0.57
Rmd 1 0.11 15 0.16 20 0.42 33 0.43

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.