Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

set_regex_indention

Set indention of tokens that match regex


Description

Force the level of indention of tokens whose text matches a regular expression pattern to be a certain amount of spaces. The rule is only active for the first tokens on a line.

Usage

set_regex_indention(
  flattened_pd,
  pattern,
  target_indention = 0,
  comments_only = TRUE
)

Arguments

flattened_pd

A flattened parse table.

pattern

A character with regular expressions to match against the token in flattened_pd.

target_indention

The desired level of indention of the tokens that match pattern.

comments_only

Boolean indicating whether only comments should be checked or all tokens.

Value

A flattened parse table with indention set to target_indention for the tokens that match regex.


styler

Non-Invasive Pretty Printing of R Code

v1.4.1
MIT + file LICENSE
Authors
Kirill Müller [aut], Lorenz Walthert [cre, aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.