Spin R Scripts into R Markdown Files

util_spin(
  dir = getwd(),
  recursive = FALSE,
  files = NULL,
  knit = FALSE,
  par = TRUE,
  ncores = NULL,
  ...
)

Arguments

dir

Character string. Directory which contains target files. Ignored if file is NOT NULL.

recursive

Logical. If TRUE, recursively spin all R scripts (.R, .r) in dir. Ignored if file is NOT NULL.

files

Character vector. Vector of files to spin.

knit

Logical. If TRUE, compiles the document after conversion.

par

Logical. If TRUE, use multiple cores.

ncores

Integer. Number of cores to use if par = TRUE. If unspecified, defaults to detectCores() - 1.

...

Arguments to pass to knitr::spin().

Author

Ivan Jacob Agaloos Pesigan

Examples

if (FALSE) { util_spin( dir = getwd(), par = FALSE ) }