Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JohnMount opened this Issue Jul 19, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@JohnMount
Copy link

JohnMount commented Jul 19, 2018

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

@jimhester jimhester added this to the 2.0.0 milestone Jul 19, 2018

@jimhester jimhester closed this in 4d01158 Jul 19, 2018

@JohnMount

This comment has been minimized.

Copy link
Author

JohnMount commented Jul 20, 2018

That was fast. Thanks!!!

Just a note: I have a vague memory that devtools::test() may or may not have a similar non-isolation issue. It didn't cause me trouble, so I didn't look into it further.

@lock

This comment has been minimized.

Copy link

lock bot commented Jan 16, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 16, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.