June 29, 2012
Wrap-up on Blogging with R Markdown and tumblr

This is a wrap-up post to summarize a few of the issues I’ve found so far with blogging on tumblr with R Markdown.

tumblr Puts a 1Mb Cap On Its HTML Editor

Fair warning.

When I tried eating my own dogfood while writing the previous posts, I found that I had to manually upload all those pretty screenshots of the tumblr interface. For some reason, tumblr was truncating the HTML I was pasting into its editor. By trial and error, I found out that they place a cap of around 1Mb on the HTML. That’s essentially 96 R plots at 504x432 pixels. How do I know? Because I placed this bit of code:

for (i in 1:96) 
   plot(rnorm(i), main = paste(i, "Squares"), 
    col = rainbow(i, alpha = runif(i, 0, 1))[round(runif(i, 1, i))], 
    pch = ".", cex = round(runif(i, 1, 100)))

into an R Markdown file, rendered it to HTML with markdownToHTML(), and uploaded it to my test blog http://testerester.tumblr.com a number of times. Maxed out at 96. Regardless, that’s 96 images I didn’t have to upload manually!

R Highlighting Is Now Fixed

I presumed that the hosted version of highlight.js contained a language definition for R. It actually does not, but it’s easy to include one. I’ve done such and am now hosting my own highlight.packed.js on rapache.net here:


and have updated the tumblr R Markdown theme here:


You Can Drop the Save in the Edit/Save/Knit Iteration

JJ Allaire assures me that you don’t have to save your R Markdown document before you knit it in RStudio. It is saved automatically, and dropping the save action speeds up iterative development by a factor 1.5!

3:17pm  |   URL: http://tmblr.co/Zf5rDyONYaXZ
(View comments  
Filed under: R rstats 
  1. leetucksing reblogged this from jeffreyhorner
  2. jeffreyhorner posted this
Blog comments powered by Disqus