For happy-R blogging

May 3, 2011
By

(This article was first published on Fabio Marroni's Blog » R, and kindly contributed to R-bloggers)

You may notice that I don’t have that many posts on my blog, and they are all about R.
The paucity of my posts makes me a bit sad, but not much, really…
What makes (or better, used to make me) sad is that posts of R code (used to) look awful.
However, your code doesn’t deserve and doesn’t need to be ugly. You can find online several beautifiers.
This page on Inside-R provides a useful tool. You just need to paste your R code in the provided form and paste it back in your page. Nice thing is that you get back HTML code so you can paste it in your blog, but also in your web site. Drawback: you get back a nearly unintelligible page full of html formatting in which your code is lost; to change even a single letter of code you will probably have to go back to your original function. You probably don’t need to edit your code now, but I got nervous about this for some strange reason. Thus, I looked for additional tools. I found out that WordPress now enables R syntax highlighting. I can assure you that it’s fairly easy (I did it!). Instructions are available on this R-bloggers page.
Since when I tried these two tools, I am an happy-R blogger!


To leave a comment for the author, please follow the link and comment on his blog: Fabio Marroni's Blog » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: 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...

Comments are closed.