R/import.R

Defines functions import

Documented in import

#' Import Files
#' 
#' Import all R-files in a directory.
#' 
#' @param ... Directory from which to import `.R` or `.r` files.
#' 
#' @examples 
#' \dontrun{import("views")}
#' 
#' @return Invisibly returns `NULL`.
#' 
#' @export
import <- function(...){{
  files <- fs::dir_ls(..., regexp = "\\.R$|\\.r$") 
  sapply(files, source)
  invisible()
}}
JohnCoene/ambiorix documentation built on Jan. 17, 2025, 11:11 p.m.