knitr::opts_chunk$set(echo = TRUE)
Convert .yaml files to a generic flat format that is more user-friendly
library(yaml) library(stringr) yml_files <- dir("../yaml/", pattern=".yaml", recursive = T) yml_file_paths <- file.path("../yaml/", yml_files) glossy_df <- sapply(yml_file_paths, function(x){ y <- read_yaml(x) Name <- names(y) Definition <- unlist(y[[1]][1]) CourseLink <- unlist(y[[1]][2]) %>% str_split(", ", simplify = T) %>% .[1] entry <- c(Name, CourseLink, Definition) names(entry) <- c("Tags","URLS","Description") return(entry) }) glossy_df <- t(glossy_df) rownames(glossy_df) <- NULL write.csv(glossy_df, "glossary.csv", row.names = F) #Name #Definition #Course Link #Source Link
devtools::session_info()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.