This configuration is used by the styling functions if no value is provided for the configuration keys. It can also serve as the base for you custom configuration.
get_default_config()
list
with the default configuration
The configuration values:
indent - the number of spaces to use for indentation.
line_length - the maximum number of characters in a line.
embracing_op_no_nl - whether to allow a newline after an embracing operator.
allow_nl_after_assignment - whether to allow a newline after an assignment operator.
space_before_complex_rhs_in_formula - whether to add a space before a complex right-hand side in a formula.
strip_suffix_whitespace_in_function_defs - whether to strip suffix whitespace in function definitions.
function_line_breaks - the type of line breaks in function definitions when arguments do not fit. Possible values are: hanging, double, single.
insert_newline_in_quote_call - whether to insert a newline in calls to quote
.
config <- get_default_config()
print(config)
#> $indent
#> [1] 2
#>
#> $line_length
#> [1] 120
#>
#> $embracing_op_no_nl
#> [1] TRUE
#>
#> $allow_nl_after_assignment
#> [1] FALSE
#>
#> $space_before_complex_rhs_in_formula
#> [1] TRUE
#>
#> $strip_suffix_whitespace_in_function_defs
#> [1] TRUE
#>
#> $function_line_breaks
#> [1] "hanging"
#>
#> $insert_newline_in_quote_call
#> [1] TRUE
#>
# Make the indent 4 spaces
config$indent <- 4
# Make the maximum line length 80 characters
config$line_length <- 80