Skip to content
Snippets Groups Projects
Commit 03363340 authored by Walmes Marques Zeviani's avatar Walmes Marques Zeviani
Browse files

Adds 'knitr::' prefix.

parent a1e08d04
No related branches found
No related tags found
No related merge requests found
......@@ -3,13 +3,12 @@
#' @name runAllChunks
#'
#' @description This function was developed to run all chunks in a knitr
#' Rmd (R markdown) file at once. Mainly for exploring and debugging
#' purposes.
#' Rmd (R markdown) file at once. Mainly for exploring and debugging
#' purposes.
#'
#' @param Rmd the name of the Rmd file.
#'
#' @param envir the environment in which the chunks will be
#' evaluated. By default it is the GlobalEnv.
#' evaluated. By default it is the GlobalEnv.
#'
#' @references This function was based on this
#' \href{http://stackoverflow.com/questions/24753969/knitr-run-all-chunks-in-an-rmarkdown-document}{SO
......@@ -27,6 +26,6 @@ runAllChunks <- function(Rmd, envir = globalenv()){
}
tempR <- tempfile(tmpdir = ".", fileext = ".R")
on.exit(unlink(tempR))
purl(Rmd, output = tempR)
knitr::purl(Rmd, output = tempR)
sys.source(tempR, envir = envir)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment