Code syntax tool for R into HTML

So this is useful for R people. Need to place some code up in HTML, want to have syntax highlighting, don’t want to fight code and pre format tags all day in wordpress? Paste your block into pretty-r:

data(tips, package="reshape2")
 
tipsAnova <- aov(tip~day-1, data=tips)
tipsLM <- lm(tip~day-1, data=tips)
summary(tipsAnova)
summary(tipsLM)

What this is doing is allowing you to maintain syntactically highlighted and well-formed R source code in your HTML pages, easily. You have already written the source in R, cut and paste it into the form, and it will return a clean set of styled HTML for pasting into any web source you need.

twitter
twitter

One thought on “Code syntax tool for R into HTML

  1. So it turns out that the crayon highlighter for wordpress breaks with input from pretty-r. https://github.com/aramk/crayon-syntax-highlighter is the github site. Turning off crayon fixes the render, but it needs to be addressed. I will make a test of the crayon highlighter syntax for R and see if it stands on its own. The problem can be directly addressed with a tag before the pretty-r html of pre class=”lang:html”>

Leave a Reply

Your email address will not be published. Required fields are marked *