set_cleanr_options {cleanr} | R Documentation |
Set Options for cleanr
Description
A convenience function for options
.
Usage
set_cleanr_options(..., reset = FALSE, overwrite = TRUE)
Arguments
... |
See |
reset |
[boolean(1)] |
overwrite |
[boolean(1)] |
Details
cleanr loads a couple of options as defaults for its
functions.
The defaults are stored in a list element of options
.
All checks (see function_checks
and file_checks
)
can be disabled by setting the corresponding option list item to NULL
or FALSE
.
Value
See Also
Other option wrappers:
get_cleanr_options()
Examples
# R.C. Martin's Clean Code recommends monadic argument lists.
cleanr::set_cleanr_options(max_num_arguments = 1)
# R.C. Martin's Clean Code recommends functions less than 20 lines long.
cleanr::set_cleanr_options(max_lines = 30, max_lines_of_code = 20)
# same as above:
cleanr::set_cleanr_options(list(max_lines = 30, max_lines_of_code = 20))
cleanr::get_cleanr_options(flatten_list = TRUE)
# we delete all options and set some anew
options("cleanr" = NULL)
options("cleanr" = list(max_lines = 30, max_lines_of_code = 20))
# fill the missing options with the package's defaults:
cleanr::set_cleanr_options(overwrite = FALSE)
cleanr::get_cleanr_options(flatten_list = TRUE)
# reset to the package's defaults:
cleanr::set_cleanr_options(reset = TRUE)
cleanr::get_cleanr_options(flatten_list = TRUE)