rmarkdown/Rscripts
library(tidyverse) setwd(here::here()) fns = list.files("inst/rmarkdown/Rscripts", recursive = TRUE) lapply(fns, function(fn){ desc = readr::read_lines(file.path("inst/rmarkdown/Rscripts", fn), n_max = 1) if (!grepl("# ", desc)){ desc = "Not given." } data.frame(fn = basename(fn), category = dirname(fn), description = gsub("#", "", desc), stringsAsFactors = FALSE) }) %>% bind_rows() %>% distinct() %>% knitr::kable()
You can get any of this doing:
source = file.path(system.file("rmarkdown", package="hbcABC"), "Rscripts", category, fn) file.copy(source, final_R)
rmarkdown/templates
library(tidyverse) setwd(here::here()) fns = list.files("inst/rmarkdown/templates", pattern = "yaml", recursive = TRUE) lapply(fns, function(fn){ yaml::read_yaml(file.path("inst/rmarkdown/templates", fn)) %>% as.data.frame() %>% select(name, description) %>% mutate(fn = dirname(fn)) }) %>% bind_rows() %>% knitr::kable()
You can get any of this doing:
source = file.path(system.file("rmarkdown", package="hbcABC"), "templates", fn, "skeleton", "skeleton.Rmd") file.copy(source, final_Rmd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.