Site icon R-bloggers

formatR update (0.1-5)

[This article was first published on Statistics, R, Graphics and Fun » R Language, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

The formatR package has been silent for quite a few months now. Recently I’ve been moving my old packages from R-Forge to GitHub, and I finally killed several things on my TODO list. In the past, I made an awkward decision to let formatR depend on the animation package, which was ridiculous. Ronggui suggested me remove this dependency long time ago, and now it came true in the new version 0.1-5 (on CRAN now). So formatR is finally a standalone package, although you can choose to use the GUI version after installing the gWidgets package (see the formatR() function). To work with command lines, tidy.source() can be helpful. It takes a file, formats it into a tidy form, and writes the output into a specified file, or simply to the console.

When I first saw the Pretty-R tool provided by Revolution Analytics, I was not completely satisfied because it is just not “pretty” enough. If they have R and the formatR package installed on the server, perhaps they can provide another option to help the users format their source code in a more beautiful way, e.g. they could have turned

x = seq(0.1,10,0.1)

to

x = seq(0.1, 10, 0.1)

(You may ask: what the heck is the difference?! In this case, you don’t need the formatR package because you are not “picky” enough…)

At the same time, I also removed the function tidy.source() from the animation package. Since this was my first R package, I tended to put everything into a single package, including some functions which are apparently irrelevant. I put them there just for my own use. Now all of them are defunct; see ?'animation-defunct' in the next version of the animation package.

Related Posts

To leave a comment for the author, please follow the link and comment on their blog: Statistics, R, Graphics and Fun » R Language.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.