styler allows you to format .qmd, .R, .Rmd, .Rmarkdown, .Rnw, and/or .Rprofile files, R packages, or entire R source trees according to a style guide. The following functions can be used for styling:

Author

Maintainer: Lorenz Walthert lorenz.walthert@icloud.com

Authors:

Other contributors:

Examples

style_text("call( 1)")
#> call(1)
style_text("1    + 1", strict = FALSE)
#> 1    + 1
style_text("a%>%b", scope = "spaces")
#> a %>% b
style_text("a%>%b; a", scope = "line_breaks")
#> a %>% b; a
style_text("a%>%b; a", scope = "tokens")
#> a %>% b()
#> a