As a fact-based blog, the posts here contain very often diagrams and data tables. To enable you to reproduce the results and insights, I include the computations as computer code.
This post gives an short introduction to the
mdtools package: how to install it, the first post, caveats, and future directions.
mdtools package is not yet on CRAN, but on a self-hosted repository. You install it by
> install.packages("mdtools", repos = c(getOption("repos"),
For Windows users, only a R 2.13 binary is available, users of other R versions need to add the
To transform the code fragments into data tables and diagrams, we use the ascii package by David Hajage, which will get installed as a dependency.
ascii itself customizes and enhances Friedrich Leisch’s Sweave tool.
To convert markdown text to HTML we use Pandoc, an universal document converter by John MacFarlane. You need to install it by yourself and make sure it is available on the path. I use version 1.8.
In order to access blogger and picasa, you need python (version >= 2.5) with Google’s gdata python client installed. The python binary needs to be on the search path.
It is assumed that you have an account at blogger and picasa, and that you have created blog titled “myblog” and that you have an album at picasa with the same name.
I give these texts the extension .Pnw, so let’s assume the text is saved as
myfirstpost.Pnw. Now, to put this document on blogger, you just load the package, instantiate a
blogger object and pass the object and the name of the text file to the function
> b <- blogger(username = "firstname.lastname@example.org", password = "scr",
+ blog = "myblog")
> pnw_to_blogger("myfirstpost.Pnw", b)
With these commands, the article gets posted.
Caveats, future directions
Please note that
- Pandoc currently does not support keywords or tags on the post. You have to set them in bloggers web interface.
- It is checked if a blog post with the same title was posted in the last 6 months. If so, this post is replaced, i.e. overwritten by the new post.
- Currently, the
asciipackage does not support captions on figures.
Since Pandoc is a univeral document converter, I plan to add converters to PDF and EPUB. Also, I am playing with a simple tcltk editor for markdown documents. Lastly, it seems not that difficult to add support for wordpress blogs.