Skip to content

state caries between runs of devtools:: build_vignettes() #1822

@JohnMount

Description

@JohnMount

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
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorvignettes 📜

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions