Wrap-up on Blogging with R Markdown and tumblr

June 29, 2012
By

(This article was first published on Jeffrey Horner, and kindly contributed to R-bloggers)

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:

http://rapache.net/stylesheets/highlight.pack.js

and have updated the tumblr R Markdown theme here:

https://github.com/jeffreyhorner/RFMExamples/blob/master/R-Markdown-tumblr-theme.html

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!

To leave a comment for the author, please follow the link and comment on his blog: Jeffrey Horner.

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.