Short version: if RStudio on Windows 7 crashes when viewing vignettes in HTML format, it may be because those packages specify
knitr::rmarkdown as the vignette engine, instead of
knitr::knitr and you’re using
Longer version with details – read on.
update: looks like this issue relates to the installed version of
rmarkdown (1.3 in my case) – see here for details.
Read the rest…
Things to know about Lorne in the state of Victoria, Australia.
- It’s situated on the Great Ocean Road, a major visitor attraction and a great way to see the scenic coastline of the region
- It’s home to a number of life science conferences including Lorne Genome 2017
This week’s project then: use R to analyse coverage of the 2017 meeting on Twitter. I last did something similar for the ISMB meeting in 2012. How things have changed. Back then I prepared PDF reports using Sweave, retrieved tweets using the
twitteR package and struggled with dates and time when plotting timelines. This time around I wrote RMarkdown in RStudio, tried out the newer rtweet package and, thanks to packages such as
lubridate, the data munging is all so much cleaner and simpler.
So without further ado here is the Github repository.
The report examines several aspects of the conference coverage under the broad headings of timeline, users, networks, retweets, favourites, quotes, media and text.
Updates from RStudio support:
(1) “Thanks for reporting and I was able to reproduce this as well. I’ve filed a bug and we’ll take a look.”
(2) Taking a further look, this is actually a bug in the Markdown package and we’ve asked the maintainer (Jeffrey Horner) to look into it.
As juejung points out in a comment on my previous post, applying custom CSS to R Markdown by sourcing the custom rendering function breaks the rendering of inline equations.
I’ve opened an issue with RStudio support and will update here with their response. In the meantime, one solution to this problem is:
- Do not create the files custom.css or style.R, as described yesterday
- Instead, just put the custom CSS at the top of your R Markdown file using style tags, as shown below
border: 1px solid #ccc;
Update August 5 2014: I noticed this post is getting some hits; please note that it is an old post, it’s probably outdated and there’s likely to be a better solution by now
People have been telling me for a while that the latest version of RStudio, the IDE for R, is a great way to generate reports. I finally got around to trying it out and for once, the hype is justified. Start with this excellent tutorial from Jeremy Anglim.
Briefly: the process is not so different to Sweave, except that (1) instead of embedding R code in LaTeX, we embed R code in a document written using R Markdown; (2) instead of Sweave, we use the knitr package; (3) the focus is on generating HTML documents for publishing to the Web (see e.g. RPubs), although knitr can also generate PDF documents, just like Sweave.
It took me a little while to figure out a couple of things. First, how best to generate HTML tables, ideally using the xtable package. Second, how to override the default RStudio/R Markdown style. I’ve documented those tasks in this post.
Read the rest…