How to: Write a CV with R Markdown

The process of maintaining a CV can be tedious. With the vitae package, creating and maintaining a Résumé or CV will be simple.

Thierry Warin https://www.nuance-r.com/principalInvestigator.html (SKEMA Business School (Raleigh, NC))https://www.skema-bs.fr/campus/campus-raleigh
07-12-2019


SKEMA Quantum Studio has made available the vitae package (O’Hara-Wild and Hyndman 2019) for you to use it. The vitae package makes creating and maintaining a Résumé or CV with R Markdown simple. It provides a collection of LaTeX templates, with helpful functions to add content to the documents.

Create a CV

Go to File > New File > R Markdown > From Template.

A window will open, showing a list of R Markdown templates provided by all installed packages installed by SKEMA Quantum Studio. You have some templates from the vitae package to use.


Like other R Markdown documents, the file is split into two sections: the YAML and the main body. Let’s take a look at it!

YAML

The YAML contains general entries that are common across many templates, such as your name, address and social media profiles. This is also where the output format (the CV template used) is specified, along with any options that the template supports. An example of what this header may look like is shown below:


---
name: Mitchell O Hara-Wild
date: "`r format(Sys.time(), '%B, %Y')`"
profilepic: pic.jpg
www: mitchelloharawild.com
github: mitchelloharawild
linkedin: mitchelloharawild
twitter: mitchoharawild
headcolor: 414141
docname: CV/Resume
output: vitae::awesomecv
---

You can also see that the output is set to vitae::awesomecv, which indicates that this CV uses the Awesome CV template. There are 4 vitae templates available:

The YAML allows these fields to be specified:

name: Your name
surname: Your family or last name
position: Your current workplace title or field
address: Your address
date: The current date
profilepic: A local file path to an image
www: Your website address
email: Your email address
twitter: Your twitter handle
github: Your GitHub handle
linkedin: Your LinkedIn username
aboutme: A short description that is included in a template specific location
headcolor: A featured colour for the template
docname: Control the document name (typically curriculum vitae, or résumé)

Document body

Like other R Markdown documents, the body allows you to mix R code with markdown to create the main content for your document. Below is an example of the start for a typical CV:

Write a setup R chunck for your entire document. The setup chunk is useful to load in any packages that you may use, and also prevent R code and warnings/notes from appearing in your CV.


```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
library(vitae)
```

Then continue your CV, with headers normally.

Unlike other R markdown formats, the vitae package and its templates support functions to generate CV entries from data: detailed_entries() and brief_entries(). Both functions provide sections for what, when, and with, and the detailed_entries() additionally supports where and why. They use an interface similar to dplyr, in that the data can be piped (%>%) into these functions, and the arguments can involve some calculations.

Detailed entries

Let’s add to the main body with some education history. These details are available on ORCID with the ID example of 0000-0001-6729-7695, which can be dynamically accessed using the rorcid package.


# Education

library(vitae)
edu <- do.call("rbind",
  rorcid::orcid_educations("0000-0001-6729-7695")$`0000-0001-6729-7695`$`affiliation-group`$summaries
)
edu %>%
  detailed_entries(
    what = `education-summary.role-title`,
    when = glue::glue("{`education-summary.start-date.year.value`} - {`education-summary.end-date.year.value`}"),
    with = `education-summary.organization.name`,

In the example above, the glue package has been used to combine the start and end years for the “when” input. Excluding any arguments is also okay (as is done for why), it will just be left blank in the CV.

Brief entries

Brief entries can be included with the same interface as detailed_entries(), and is appropriate for entries that do not need as much detail (such as skills). Another application of this is to include a list of R packages that you have published to CRAN using the pkgsearch package.


# R Packages

pkgsearch::ps("O'Hara-Wild",size = 100) %>%
  filter(purrr::map_lgl(package_data, ~ grepl("Mitchell O'Hara-Wild", .x$Author, fixed = TRUE))) %>%
  arrange(desc(downloads_last_month)) %>%
  brief_entries(
    what = title,
    when = lubridate::year(date),

This example also uses several other packages to prepare the data: - dplyr to filter() my contributed packages, and arrange() the data by downloads - purrr to map over package_data column to find packages I’ve contributed to - lubridate to display only the year from the date column.



O’Hara-Wild, Mitchell, and Rob Hyndman. 2019. “Vitae: Curriculum Vitae for R Markdown.” https://CRAN.R-project.org/package=vitae.

Citation

For attribution, please cite this work as

Warin (2019, July 12). Virtual Campus: How to: Write a CV with R Markdown. Retrieved from https://virtualcampus.skemagloballab.io/posts/howto-writeacvwithrmarkdown/

BibTeX citation

@misc{warin2019how,
  author = {Warin, Thierry},
  title = {Virtual Campus: How to: Write a CV with R Markdown},
  url = {https://virtualcampus.skemagloballab.io/posts/howto-writeacvwithrmarkdown/},
  year = {2019}
}