Last active
October 3, 2021 08:58
-
-
Save gkaramanis/df86ebc15e61d2aa8bd708ccb80cde81 to your computer and use it in GitHub Desktop.
geom_stream vs. geom_line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(ggstream) | |
papers <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-09-28/papers.csv') | |
programs <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-09-28/programs.csv') | |
paper_programs <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-09-28/paper_programs.csv') | |
pp <- programs %>% | |
mutate(program_category = replace_na(program_category, "Technical")) %>% | |
left_join(paper_programs) %>% | |
left_join(papers) %>% | |
count(year, program_desc) %>% | |
filter(program_desc == "Development Economics" | program_desc == "Labor Studies") | |
ggplot(pp, aes(x = year, y = n, fill = program_desc, label = program_desc)) + | |
geom_stream(type = "ridge") + | |
geom_stream_label(type = "ridge") | |
ggplot(pp, aes(x = year, y = n, color = program_desc, group = program_desc)) + | |
geom_line() |
Author
gkaramanis
commented
Oct 3, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment