View source: R/retrieve_rmds.R
retrieve_rmds | R Documentation |
Recursively searches file structure for Rmarkdown files. Returns the found Rmd relative paths.
retrieve_rmds(search_dir = ".", recurse = TRUE, to_txt = FALSE)
search_dir |
The directory to search. Defaults to ".". |
recurse |
Defaults to TRUE. Should child directories be searched or not. |
to_txt |
Defaults to FALSE. If TRUE, writes found rmd paths in a txt to
the |
Relative paths to all found Rmd files.
# Create a test directory dir.create("parent") dir.create("parent/child") # Create some rmds to find # An empty vector to collect file names nm_vec <- character() # create numbered file names for (num in 1:6) { nm <- paste0(num, "-test.Rmd") nm_vec <- append(nm_vec, nm) } # Create some files in parent & child directories file.create(paste0("parent/", nm_vec[1:3])) file.create(paste0("parent/child/", nm_vec[4:6])) # Return all Rmd files retrieve_rmds("parent") # tidy up environment unlink(c("parent", "child"), recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.