#' Source all scripts in a directory
#'
#' Source all scripts in a directory
#' @param dir the directory you want to source
#' @keywords source
#' @export
#' @examples
#' source_directory(here::here("R"))
source_directory <- function(dir){
assertthat::assert_that(
assertive::is_dir(dir),
msg = "The string you supplied as the dir argument in source_directory() does not represent a valid directory"
)
files <- fs::path(dir, list.files(dir))
purrr::walk(files, source)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.