« R is Hot: Part 5 | Main | ACM Data Mining Camp 3 »

November 04, 2010


Feed You can follow this conversation by subscribing to the comment feed for this post.

Personally I really do not like the underlines. And the highlight (http://www.andre-simon.de/) software has been there for ages, which supports R language as well. I used it a couple of years ago, but later I found it was not a good idea to use the hard-coded HTML to dress up R code (very difficult to maintain). Now I'm using SyntaxHighlighter, which can highlight R code (as well as other languages) dynamically using JavaScript -- we do not need to worry about possible future changes to our code. It seems Pretty R is using GeSHi.

A detailed explanation on how to use SyntaxHighlighter in any web pages to highlight R language: http://yihui.name/en/2010/09/syntaxhighlighter-brush-for-the-r-language/

Thanks for the comments Yihui, some useful links there. Pretty R is a web-based tool, so it's nice that there's no program you have to download, just fill out the form and your done. I don't use WordPress so I can't use SyntaxHighlighter, and I do find the fact that Pretty R links to documentation pretty useful. (You can control the appearance of the underlines with CSS if you want, too.)

I vote a big YES for the underlines! I'm using Pretty R formattted scripts in examples posted to my course web pages for my undergraduate statistics courses. The links are a painless way to get my students into the documentation. Thanks.

Thanks for the tip (and for the compliment about my blog...). I have to check if dotclear likes it (this is the reason why I used this purple color for my R code... it was the only way to include R code, and to make clear that it was not some text),

To make it clear, SyntaxHighlighter has nothing to do with WordPress. It can be used in any HTML pages.

As I said, it is hard to maintain the code once it was converted to HTML. SyntaxHighlighter can keep the code "clean" and easy to maintain, because it uses JavaScript to highlight the content of the 'pre' tag. Anyway, if we are confident that our code is mature once written, Pretty-R can be a useful tool. In comparison, SyntaxHighlighter does not even require the Internet connection...

@Mike Anderson: Actually I mean the aesthetics, so my opinion is completely personal and can be biased. I guess underlines were heavily used quite a few years ago and they are rare now in modern web pages.

I really like this little tool :)

Though, if you're offline, if you use RKWard, you only have to do File -> Export as HTML... and you're done.

The comments to this entry are closed.

Search Revolutions Blog

Got comments or suggestions for the blog editor?
Email David Smith.
Follow revodavid on Twitter Follow David on Twitter: @revodavid
Get this blog via email with Blogtrottr