styler allows you to format .R files, packages or entire R source trees according to a style guide. The following functions can be used for styling:
style_text()
to style a character vector.
style_file()
to style a single .R file.
style_dir()
to style all .R files in a directory.
style_pkg()
to style the source files of an R package.
An RStudio Addin to style the active file .R file and the current package.
Useful links:
Report bugs at https://github.com/krlmlr/styler/issues
style_text("call( 1)")#> [1] "call(1)"#> [1] "1 + 1"#> [1] "a %>% b"#> [1] "a %>%" " b; a"#> [1] "a %>%" " b()" "a"