Start by loading packages.

library(fs)
library(tidyverse)
library(emo)
library(here)
library(glue)
library(knitr)

Use fs to get a list of all Rmd files in the subfolders of the static/slides folder.

files <- fs::dir_info(here("static", "slides"), recursive = TRUE, glob = "*.Rmd") %>%
  slice(-1) %>%
  mutate(path = as.character(path)) %>%
  select(path)

Define two functions for extracting the title and emoji keyword from the second line of each Rmd file. This is the line that contains the title in the YAML.

extract_title <- function(x){
  read_lines(as.character(x), skip = 1, n_max = 1) %>%
    str_extract(" .*\\<") %>%
    str_remove('\"') %>% 
    str_remove("\\<") %>% 
    str_trim()
}
extract_keyword <- function(x){
  read_lines(as.character(x), skip = 1, n_max = 1) %>%
    str_extract("emo::ji\\(.*\\)") %>%
    str_remove("emo::ji\\('") %>% 
    str_remove("'\\)")
}

Grab titles, keywords, and find corresponding emojis, with a little bit of help from here.

files <- files %>%
  mutate(
    title = map(path, extract_title) %>% unlist(),
    keyword = map(path, extract_keyword) %>% unlist(),
    emoji = map_chr(keyword, function(x) glue(emo::ji_name[x], collapse = ""))
  )

View titles, keywords, and emojis.

files %>%
  select(title, emoji, keyword) %>%
  kable()
title emoji keyword
Welcome to Data Science ๐Ÿ™Œ raised_hands
Meet the toolkit โš’ hammer_and_pick
Data and visualization ๐Ÿ“‰ chart_with_downwards_trend
Tidy data and data wrangling ๐Ÿ”ง wrench
Tips for effective data visualization ๐Ÿ’… nail_polish
Merge conflicts โ›” no_entry
Implementing principles for effective visualizations in R ๐Ÿ‘ฉโ€๐ŸŽจ woman_artist
Coding style ๐Ÿ‘— dress
Scientific studies, confounding, and Simpsonโ€™s paradox ๐Ÿ˜– confounded
Data classes and types + Recoding ๐Ÿ’ฝ minidisc
Review + recap ๐Ÿงข billed_cap
Web scraping ๐Ÿ•ธ spider_web
Functions and automation ๐Ÿค– robot
The language of models ๐Ÿ“ˆ chart_with_upwards_trend
Simple linear regression ๐Ÿก dango
Multiple linear regression ๐Ÿคนโ€โ™€ woman_juggling
Model selection ๐Ÿ‘Œ ok_hand
Model validation + prediction ๐Ÿ”ฎ crystal_ball
Estimation via bootstrapping ๐Ÿ‘ข boot
Hypothesis testing via simulation ๐Ÿ†Ž ab
Inference for regression ๐Ÿ“ straight_ruler
Central limit theorem ๐Ÿช dromedary_camel
Inference and modeling review ๐Ÿ‘€ eyes