Styles all R scripts and R Markdown files in a given directory.

util_style(
  dir = getwd(),
  recursive = FALSE,
  files = NULL,
  par = TRUE,
  ncores = NULL
)

Arguments

dir

Character string. Directory.

recursive

Logical. If TRUE, recursively style all R scripts (.R, .r) and R Markdown files (.Rmd, .rmd) in dir.

files

Character vector. Vector of files to style.

par

Logical. If TRUE, use multiple cores.

ncores

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

Author

Ivan Jacob Agaloos Pesigan

Examples

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