The goal of styler is to provide non-invasive pretty-printing of R source code while adhering to the tidyverse formatting rules. Support for custom style guides is planned.
You can install the package from CRAN:
Or get the development version from GitHub:
You can style a simple character vector of code with
There are a few variants of
style_file()styles .R and/or .Rmd files.
style_dir()styles all .R files in a directory.
style_pkg()styles the source files of an R package.