I have been looking for this type of package for several days, and luckily found it today. Unquestionable R is powerful, however, R programming is unfriendly as far as I concern, mainly due to the lack of format shortcut, which makes the R codes rather ugly. (It is an absolute advantage of Matlab, for example, ctrl+R for comment, ctrl+T for uncomment, ctrl+I for smart indent, etc.)

FormatR is the package for tidying R source code, although it is less convenient to use than the straightforward shortcuts in Matlab, this package is good enough for me, what is it for? as the title suggest:

Quotation

formatR: format R code automatically, farewell to ugly R code

Below is a comparison before and after using FormatR.

**Before:**

**After:**

Download the package at http://cran.r-project.org/web/packages/formatR/index.html

Tags – r

**Read the full post at Excellent R Code Format Package**.

*Related*

R-bloggers.com offers

**daily e-mail updates** about

R news and

tutorials on topics such as:

Data science,

Big Data, R jobs, visualization (

ggplot2,

Boxplots,

maps,

animation), programming (

RStudio,

Sweave,

LaTeX,

SQL,

Eclipse,

git,

hadoop,

Web Scraping) statistics (

regression,

PCA,

time series,

trading) and more...

If you got this far, why not

__subscribe for updates__ from the site? Choose your flavor:

e-mail,

twitter,

RSS, or

facebook...