R/ksource.R

Defines functions ksource

Documented in ksource

# https://stackoverflow.com/questions/10966109/how-to-source-r-markdown-file-like-sourcemyfile-r
# doesn't load eval=FALSE

#' A function to source .Rmd files.
#' @param x Path to a .Rmd file.
#' @param ... Arguments to pass on.
#' 
#' @author Andreas Scharmueller, \email{andschar@@proton.me}
#' 
#' @export
#'
ksource = function(x, ...) {
  source(knitr::purl(x, output = tempfile()),
         ...)
}
andschar/andmisc documentation built on Jan. 19, 2025, 10:46 a.m.