Skip to content

Instantly share code, notes, and snippets.

@reuning
Created July 22, 2024 17:21
Show Gist options
  • Save reuning/9e94b3095428488e47aebd72dfb37a36 to your computer and use it in GitHub Desktop.
Save reuning/9e94b3095428488e47aebd72dfb37a36 to your computer and use it in GitHub Desktop.
NYT Pundits Ratings of Democratic Candidates
Candidate Pundit Electable Exciting
Harris Barkan 5 6
Harris Barro 4 4
Harris Bouie 7 9
Harris Coaston 4 5
Harris Douthat 3 5
Harris Goldberg 5 9
Harris Healy 6 6
Harris Paul 3 2
Whitmer Barkan 7 7
Whitmer Barro 7 6
Whitmer Bouie 7 9
Whitmer Coaston 3 4
Whitmer Douthat 7 7
Whitmer Goldberg 7 8
Whitmer Healy 7 8
Whitmer Paul 6 8
Newsom Barkan 5 6
Newsom Barro 2 4
Newsom Bouie 5 9
Newsom Coaston 7 1
Newsom Douthat 5 4
Newsom Goldberg 5 8
Newsom Healy 5 5
Newsom Paul 4 4
Warnock Barkan 8 7
Warnock Barro 5 6
Warnock Bouie 7 7
Warnock Coaston 4 6
Warnock Douthat 4 6
Warnock Goldberg 6 8
Warnock Healy 7 6
Warnock Paul 3 3
Kelly Barkan 8 7
Kelly Barro 6 4
Kelly Bouie 7 5
Kelly Coaston 5 7
Kelly Douthat 8 5
Kelly Goldberg 8 8
Kelly Healy 4 5
Kelly Paul 7 8
Murphy Barkan 5 5
Murphy Barro 5 4
Murphy Bouie 5 4
Murphy Coaston 2 3
Murphy Douthat 5 3
Murphy Goldberg 8 7
Murphy Healy 4 4
Murphy Paul 7 6
Pritzker Barkan 5 5
Pritzker Barro 5 3
Pritzker Bouie 7 6
Pritzker Coaston 3 3
Pritzker Douthat 4 3
Pritzker Goldberg 8 8
Pritzker Healy 5 4
Pritzker Paul 4 4
Beshear Barkan 7 5
Beshear Barro 7 6
Beshear Bouie 6 3
Beshear Coaston 3 3
Beshear Douthat 7 4
Beshear Goldberg 9 7
Beshear Healy 5 5
Beshear Paul 8 8
Moore Barkan 6 6
Moore Barro 5 4
Moore Bouie 7 7
Moore Coaston 2 3
Moore Douthat 4 3
Moore Goldberg 7 6
Moore Healy 4 6
Moore Paul 8 8
Shapiro Barkan 7 6
Shapiro Barro 7 5
Shapiro Bouie 8 8
Shapiro Coaston 6 4
Shapiro Douthat 7 5
Shapiro Goldberg 8 7
Shapiro Healy 7 6
Shapiro Paul 6 6
library(tidyverse)
library(ggpubr)
library(ggrepel)
data <- read_csv("nyt_pundits.csv")
sum_data <- data |> group_by(Pundit) |>
summarize(Avg_Elect=mean(Electable),
Avg_Excit=mean(Exciting))
ggplot(data, aes(x=Electable, y=Exciting, color=Candidate)) +
geom_hline(aes(yintercept=Avg_Excit), data=sum_data, linetype="dashed", alpha=.5) +
geom_vline(aes(xintercept=Avg_Elect), data=sum_data, linetype="dashed", alpha=.5) +
geom_point() +
geom_text_repel(aes(label=Candidate), min.segment.length = 0,
show.legend = FALSE) +
facet_wrap(~Pundit) +
theme_pubr() +
theme(legend.position = "bottom") +
scale_color_viridis_d(begin=0.05,
end=0.95)
ggsave("NYT_Pundits.png", height=10, width=10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment