Learn R Programming

tergo (version 0.1.9)

style_pkg: Style a package

Description

Style a package

Usage

style_pkg(
  path = ".",
  config_file = "tergo.toml",
  configuration = list(),
  force = FALSE,
  extensions = c(".R", ".r"),
  verbose = interactive()
)

Value

No return values, called for side effects.

Arguments

path

(character) The path to the package. Default ".".

config_file

(character) The path to the configuration file. Default "tergo.toml".

configuration

(list) Configuration for formatting. Default list().

force

(logical(1)) Whether to format the files even if no package was found. TRUE - format the .R and .r files found in the directory (recursive). FALSE exit without formatting anything. Default FALSE.

extensions

(character) The extensions of the files to format. Default c(".R", ".r").

verbose

(logical(1)) Whether per file status and run statistics should be printed. Default interactive().

Details

Configuration is read from a file named tergo.toml in the root of the package. The precedence of the configuration is (from the highest to lowest):

  1. The configuration passed to the function.

  2. The configuration file.

To see possible configuration options, see get_default_config().

Examples

Run this code
style_pkg()
style_pkg(path = "./tergo", config_file = "custom_tergo.toml", verbose = TRUE)

Run the code above in your browser using DataLab