Skip to content

Instantly share code, notes, and snippets.

@daranzolin
Created September 27, 2022 15:41
Show Gist options
  • Save daranzolin/7fe49bfb570e41b76edd55ecda97013a to your computer and use it in GitHub Desktop.
Save daranzolin/7fe49bfb570e41b76edd55ecda97013a to your computer and use it in GitHub Desktop.
library(tidyverse)
library(ggalt)
library(ggforce)
df <- tibble(
x = 1:43,
y = c(rep(1, 10), 3.5, 6.5, 9, 2.75, 3, 13, 14, 15, 16, 17, 17.5, 18, 8, 9, 11.5, 13, 14, 15, 25.75, 27.75, 28, 28, 28.5, 28.75, 29, 34, 39, rep(NA, 6)),
desc = c(
"Creates GitHub Account",
rep(NA, 7),
"Installs rsfsu",
rep(NA, 3),
"Using dplyr and ggplot!",
"Afraid to update rsfsu",
NA,
"Using RMarkdown!",
rep(NA, 7),
"Uses merge() and setwd(), sneaks Excel",
rep(NA, 4),
"First commit to rsfsu!",
rep(NA, 7),
"Masters functions and purrr!",
rep(NA, 6)
)
)
ggplot(df, aes(x, y)) +
labs(
x = "Time",
y = "Emily's R Knowledge",
title = "Emily's R Journey"
) +
annotate(
"rect",
xmin = 0,
xmax = 9,
ymin = -Inf,
ymax = Inf,
fill = "#FF0000",
alpha = 0.3
) +
annotate(
"rect",
xmin = 9,
xmax = 23,
ymin = -Inf,
ymax = Inf,
fill = "#00A08A",
alpha = 0.3
) +
annotate(
"rect",
xmin = 23,
xmax = 32,
ymin = -Inf,
ymax = Inf,
fill = "#F2AD00",
alpha = 0.3
) +
annotate(
"rect",
xmin = 32,
xmax = Inf,
ymin = -Inf,
ymax = Inf,
fill = "#F98400",
alpha = 0.3
) +
annotate(
"text",
x = 4,
y = 45,
label = "The\nDormant\nPeriod"
) +
annotate(
"text",
x = 14,
y = 45,
label = "The\nCompetent Learner\nPeriod"
) +
annotate(
"text",
x = 37,
y = 45,
label = "The\nFuture..."
) +
geom_mark_circle(
label.family = "Palatino",
linetype = 0,
label.fontface = "italic",
con.cap = 10,
aes(description = desc, filter = !is.na(desc))
) +
geom_xspline(size=0.5, linetype = "dashed") +
ylim(0, 50) +
xlim(0, 40) +
hrbrthemes::theme_ipsum(grid = FALSE) +
theme(
axis.text.y = element_blank(),
axis.text.x = element_blank())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment