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

update_newlines

Update the newlines attribute


Description

As we work only with the lag_newlines attribute for setting the line breaks (R/rules-line_breaks.R), but we need newlines to determine whether or not to set spaces (R/rules-spaces.R), we have to update the attribute. We cannot simply use dplyr::lead(pd$lag_newlines) since we would lose information for the last token. spaces is left as is in R/rules-spacing.R for tokens at the end of a line since this allows styling without touching indention.

Usage

update_newlines(pd)

Arguments

pd

A parse table.

Value

A parse table with synchronized lag_newlines and newlines columns.

See Also

choose_indention


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.