The formatR package was designed to reformat R code to improve readability; the main workhorse is the function tidy.source().
The formatR package was designed to reformat R code to improve readability; the main workhorse is the function tidy.source().
The package can be used to reformat R code: spaces and indent will be added to R code automatically, so that the code will be more human-readable and tidy. This package also provides a GUI (by gWidgets) to format R source code.