Convert flat .csv glossary to a JSON for use with targets pipeline.
library(rjson) library(stringr) gloss <- read.csv("../flat/glossary.csv") gloss <- gloss[order(gloss$Tags),] gloss_json <-toJSON(gloss) write(gloss_json, "glossary.json") #Name #Definition #Course Link #Source Link gloss_list <- apply(gloss,1,function(x){ y <-as.list(x) y <- list(y) names(y)<- unlist(x[1]) return(y) }) gloss_list <- unlist(gloss_list,recursive=F) names(gloss_list) <- NULL gloss_json <- toJSON(gloss_list) write(gloss_json, "glossary2.json")
devtools::session_info()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.