State caries between runs of devtools:: build_vignettes(). This can cause a problem as side-effects of one vignette run can effect others. Below is an example where if devtools:: build_vignettes() is run in a clean environment everything is fine. However if devtools:: build_vignettes() is then re-run it errors out (due to a value assignment being left behind from the first run).
---
title: "title"
author: "author"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{example}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Running `devtools::build_vignettes()` twice in a row with this file as a vignette errors
out because the assignment "`ChickWeight <- NULL`" stays live between runs and then
obscures the original `datasets::ChickWeight`.
```{r}
ChickWeight <- dplyr::mutate(ChickWeight, Time = Time+1)
ChickWeight <- NULL
```
State caries between runs of
devtools:: build_vignettes(). This can cause a problem as side-effects of one vignette run can effect others. Below is an example where ifdevtools:: build_vignettes()is run in a clean environment everything is fine. However ifdevtools:: build_vignettes()is then re-run it errors out (due to a value assignment being left behind from the first run).