---
title: "CV timeline"
author: "[Antoine Soetewey](https://antoinesoetewey.com/)"
# date: "`r Sys.Date()`"
format:
html:
toc: true
# toc-depth: 6
number-sections: true
code-fold: true
code-tools: true
# theme: flatly
# highlight-style: tango
self-contained: true
citations-hover: true
citation-location: margin
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
fig.align = "center",
out.width = "100%",
tidy = "styler",
warning = FALSE,
message = FALSE,
echo = TRUE
)
set.seed(42)
# install.packages("devtools")
library(devtools)
# devtools::install_github("laresbernardo/lares")
library(lares)
library(ggplot2)
```
```{r, warning = FALSE}
# code adapdated from Bernardo Lares
order <- c("Role", "Place", "Type", "Start", "End")
today <- as.character(Sys.Date())
cv <- data.frame(rbind(
c("PhD Candidate in Statistics", "UCLouvain", "Academic", "2017-09-01", today),
c("MSc in Econometrics", "Maastricht University", "Academic", "2015-09-01", "2016-08-31"),
c("MSc in Economics", "KULeuven", "Academic", "2013-09-01", "2015-01-01"),
c("Faculty Exchange", "UIUC, USA", "Academic", "2014-08-01", "2014-12-31"),
c("BSc in Economics", "UCLouvain", "Academic", "2010-09-01", "2013-08-31"),
c("Teaching Assistant in Statistics", "UCLouvain", "Work Experience", "2017-09-01", today),
c("Data Scientist Consultant", "Business & Decision", "Work Experience", "2016-09-01", "2017-07-31"),
c("European Public Affairs Intern", "BNP Paribas", "Work Experience", "2015-04-01", "2015-07-31"),
c("Audit Intern", "Deloitte Luxembourg", "Work Experience", "2015-01-01", "2015-03-31"),
c("International Tennis Chair Umpire", "International Tennis Federation", "Extra", "2015-05-01", today),
c("Private Tutor in Statistics and R", "easystat.be", "Extra", "2019-01-01", today),
c("Consultant in Data Science", "datanalyze.be", "Extra", "2019-01-01", today),
c("Blog Author", "statsandr.com", "Extra", "2019-12-01", today)
))
colnames(cv) <- order
colour <- c("red", "blue", "green")
plot_timeline2 <- function(event, start, end = start + 1, label = NA, group = NA,
title = "Curriculum Vitae Timeline", subtitle = "Antoine Soetewey",
size = 7, colour = "orange", save = FALSE, subdir = NA) {
df <- data.frame(
Role = as.character(event), Place = as.character(label),
Start = lubridate::date(start), End = lubridate::date(end),
Type = group
)
cvlong <- data.frame(pos = rep(
as.numeric(rownames(df)),
2
), name = rep(as.character(df$Role), 2), type = rep(factor(df$Type,
ordered = TRUE
), 2), where = rep(
as.character(df$Place),
2
), value = c(df$Start, df$End), label_pos = rep(df$Start +
floor((df$End - df$Start) / 2), 2))
maxdate <- max(df$End)
p <- ggplot(cvlong, aes(
x = value, y = reorder(name, -pos),
label = where, group = pos
)) + geom_vline(
xintercept = maxdate,
alpha = 0.8, linetype = "dotted"
) + labs(
title = title,
subtitle = subtitle, x = NULL, y = NULL, colour = NULL
) +
theme_minimal()
if (!is.na(cvlong$type)[1] | length(unique(cvlong$type)) >
1) {
p <- p + geom_line(aes(color = type), linewidth = size) +
facet_grid(type ~ ., scales = "free", space = "free") +
guides(colour = FALSE) +
scale_colour_hue()
}
else {
p <- p + geom_line(linewidth = size, colour = colour)
}
p <- p + geom_label(aes(x = label_pos),
colour = "black",
size = 2, alpha = 0.7
)
if (save) {
file_name <- "cv_timeline.png"
if (!is.na(subdir)) {
dir.create(file.path(getwd(), subdir), recursive = T)
file_name <- paste(subdir, file_name, sep = "/")
}
p <- p + ggsave(file_name, width = 8, height = 6)
message(paste("Saved plot as", file_name))
}
return(p)
}
plot_timeline2(
event = cv$Role,
start = cv$Start,
end = cv$End,
label = cv$Place,
group = cv$Type,
save = FALSE,
subtitle = "Antoine Soetewey"
)
```
See my detailed CV at [antoinesoetewey.com/cv](https://antoinesoetewey.com/cv/) or go back to my [homepage](https://antoinesoetewey.com/).
Learn how to create your own timeline CV in R in this [tutorial](https://statsandr.com/blog/how-to-create-a-timeline-of-your-cv-in-r/).