HTML vignettes crashing your RStudio? This may be the reason

March 5, 2017

(This article was first published on R – What You're Doing Is Rather Desperate, and kindly contributed to R-bloggers)

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 rmarkdown v1.

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.

HTML documentation for broom in RStudio

HTML documentation for broom in RStudio

At work I run RStudio (currently version 1.0.136) on Windows 7 (because I have no choice). This works:

  1. open the Packages tab
  2. click on broom
  3. click on User guides, package vignettes and other documentation
  4. click on HTML to see documentation for broom::broom


HTML documentation for dplyr in RStudio

HTML documentation for dplyr in RStudio

If I do the same for the dplyr package and choose the HTML documentation for dplyr::two-table, the results is not so pleasing (see image, right). Click on Debug for an uninformative message:

an unhandled win 32 exception occurred in rstudio.exe [10276].

Looking at the RMD source for the vignettes, we see that dplyr specifies knitr::rmarkdown for the vignette engine, whereas broom specifies knitr::knitr.

# dplyr
title: "Two-table verbs"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Two-table verbs}

# broom

Some further investigation suggests that the crash occurs for all packages where %\VignetteEngine{knitr::rmarkdown}, but not for those where %\VignetteEngine{knitr::knitr}. As it happens, I’ve just written a package which used knitr::rmarkdown (and crashed RStudio) and so was able to confirm that switching to knitr::knitr fixed the problem.

Filed under: R, statistics Tagged: debug, rstudio, software, windows

To leave a comment for the author, please follow the link and comment on their blog: R – What You're Doing Is Rather Desperate. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, 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.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)