<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/html-vignettes-crashing-your-rstudio-this-may-be-the-reason/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://nsaunders.wordpress.com/2017/03/06/html-vignettes-crashing-your-rstudio-this-may-be-the-reason/"> R – What You're Doing Is Rather Desperate</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Short version: if RStudio on Windows 7 crashes when viewing vignettes in HTML format, it may be because those packages specify <code>knitr::rmarkdown</code> as the vignette engine, instead of <code>knitr::knitr</code> and you’re using <code>rmarkdown</code> v1.</p>
<p>Longer version with details – read on.</p>
<p><em>update: looks like this issue relates to the installed version of <code>rmarkdown</code> (1.3 in my case) – see <a target="_blank" rel="nofollow" href="https://github.com/yihui/knitr/blob/master/vignettes/knitr-markdown.Rmd">here for details</a></em>.</p>
<p><span></span></p>
<div data-shortcode="caption" class="wp-caption"><a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/2017/03/06/html-vignettes-crashing-your-rstudio-this-may-be-the-reason/broom/"><img sizes="(max-width: 300px) 100vw, 300px" data-image-description="" data-orig-file="https://nsaunders.files.wordpress.com/2017/03/broom.png" data-orig-size="731,412" data-image-title="broom" class="wp-image-4713" data-comments-opened="1" data-recalc-dims="1" data-attachment-id="4713" data-permalink="https://nsaunders.wordpress.com/2017/03/06/html-vignettes-crashing-your-rstudio-this-may-be-the-reason/broom/" alt="HTML documentation for broom in RStudio" data-medium-file="https://i1.wp.com/nsaunders.files.wordpress.com/2017/03/broom.png?resize=300%2C169&amp;ssl=1" data-large-file="https://nsaunders.files.wordpress.com/2017/03/broom.png?w=731" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i1.wp.com/nsaunders.files.wordpress.com/2017/03/broom.png?resize=300%2C169&ssl=1"></a>
<p class="wp-caption-text">HTML documentation for broom in RStudio</p>
</div>
<p>At work I run RStudio (currently version 1.0.136) on Windows 7 (because I have no choice). This works:</p>
<ol>
<li>open the <code>Packages</code> tab</li>
<li>click on <code>broom</code></li>
<li>click on <code>User guides, package vignettes and other documentation</code></li>
<li>click on <code>HTML</code> to see documentation for <code>broom::broom</code></li>
</ol>
<p> </p>
<div data-shortcode="caption" class="wp-caption"><a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/2017/03/06/html-vignettes-crashing-your-rstudio-this-may-be-the-reason/dplyr/"><img sizes="(max-width: 300px) 100vw, 300px" data-image-description="" data-orig-file="https://nsaunders.files.wordpress.com/2017/03/dplyr.png" data-orig-size="730,445" data-image-title="dplyr" data-comments-opened="1" class="wp-image-4715" data-recalc-dims="1" data-attachment-id="4715" data-permalink="https://nsaunders.wordpress.com/2017/03/06/html-vignettes-crashing-your-rstudio-this-may-be-the-reason/dplyr/" alt="HTML documentation for dplyr in RStudio" data-medium-file="https://i0.wp.com/nsaunders.files.wordpress.com/2017/03/dplyr.png?resize=300%2C183&amp;ssl=1" data-large-file="https://nsaunders.files.wordpress.com/2017/03/dplyr.png?w=730" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i0.wp.com/nsaunders.files.wordpress.com/2017/03/dplyr.png?resize=300%2C183&ssl=1"></a>
<p class="wp-caption-text">HTML documentation for dplyr in RStudio</p>
</div>
<p>If I do the same for the <code>dplyr</code> package and choose the HTML documentation for <code>dplyr::two-table</code>, the results is not so pleasing (see image, right). Click on <code>Debug</code> for an uninformative message:</p>
<p><code>an unhandled win 32 exception occurred in rstudio.exe [10276].</code></p>
<p>Looking at the RMD source for the vignettes, we see that <code>dplyr</code> specifies <code>knitr::rmarkdown</code> for the vignette engine, whereas broom specifies <code>knitr::knitr</code>.</p>
<pre>
# dplyr
---
title: &quot;Two-table verbs&quot;
date: &quot;`r Sys.Date()`&quot;
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Two-table verbs}
  %\VignetteEngine{knitr::rmarkdown}
  \usepackage[utf8]{inputenc}
---

# broom
&lt;!-- %\VignetteEngine{knitr::knitr} %\VignetteIndexEntry{Introduction to broom} -->
</pre>
<p>Some further investigation suggests that the crash occurs for all packages where <code>%\VignetteEngine{knitr::rmarkdown}</code>, but not for those where <code>%\VignetteEngine{knitr::knitr}</code>. As it happens, I’ve just written a package which used <code>knitr::rmarkdown</code> (and crashed RStudio) and so was able to confirm that switching to <code>knitr::knitr</code> fixed the problem.</p>
<p>Filed under: <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/category/statistics/r/">R</a>, <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/category/statistics/">statistics</a> Tagged: <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/tag/debug/">debug</a>, <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/tag/rstudio/">rstudio</a>, <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/tag/software/">software</a>, <a target="_blank" rel="nofollow" href="https://nsaunders.wordpress.com/tag/windows/">windows</a> <a target="_blank" rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nsaunders.wordpress.com/4711/"><img alt="" src="http://feeds.wordpress.com/1.0/comments/nsaunders.wordpress.com/4711/" border="0"></a> <img alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" border="0" data-recalc-dims="1"></p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://nsaunders.wordpress.com/2017/03/06/html-vignettes-crashing-your-rstudio-this-may-be-the-reason/"> R – What You're Doing Is Rather Desperate</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/JG6AfkSZBOM"></a></div>