diff --git a/vignettes/crunch.Rmd b/vignettes/crunch.Rmd index b806ddadf..dab87e713 100644 --- a/vignettes/crunch.Rmd +++ b/vignettes/crunch.Rmd @@ -17,6 +17,8 @@ library(crunch) ```{r, results='hide', include = FALSE} set_crunch_opts("crunch.api" = "https://team.crunch.io/api/") library(httptest) +run_cleanup <- !dir.exists("crunch") +httpcache::clearCache() start_vignette("crunch") ``` @@ -273,8 +275,10 @@ This vignette has gone through some of the basics of working with crunch in R in ```{r, include=FALSE} end_vignette() -with_consent(delete(ds)) -with_consent(delete(my_project)) +if (run_cleanup) { + with_consent(delete(ds)) + with_consent(delete(my_project)) +} ``` * [Variables](variables.html): cleaning and defining variable metadata diff --git a/vignettes/fork-and-merge.Rmd b/vignettes/fork-and-merge.Rmd index d32aae78d..36941cd47 100644 --- a/vignettes/fork-and-merge.Rmd +++ b/vignettes/fork-and-merge.Rmd @@ -21,6 +21,7 @@ set_crunch_opts("crunch.api" = "https://team.crunch.io/api/") library(httptest) run_cleanup <- !dir.exists("fork-and-merge") ds_to_delete <- c() +httpcache::clearCache() start_vignette("fork-and-merge") diff --git a/vignettes/subtotals.Rmd b/vignettes/subtotals.Rmd index b0cac5311..408bc0e3e 100644 --- a/vignettes/subtotals.Rmd +++ b/vignettes/subtotals.Rmd @@ -19,7 +19,8 @@ set_crunch_opts("crunch.api" = "https://team.crunch.io/api/") options(width=120) library(httptest) -if (!dir.exists("subtotals")) { +remake_fixtures <- !dir.exists("subtotals") +if (remake_fixtures) { if ("rcrunch subtotal vignette" %in% names(datasets(cd(projects(), "examples/rcrunch vignette data")))) { ds <- loadDataset("example vignette ds - subtotal", project = "examples/rcrunch vignette data") with_consent(delete(ds)) @@ -34,8 +35,9 @@ if (!dir.exists("subtotals")) { httpcache::clearCache() } -run_cleanup <- !dir.exists("subtotals") +httpcache::clearCache() start_vignette("subtotals") + ds <- loadDataset("example vignette ds - subtotal", project = "examples/rcrunch vignette data") ``` @@ -192,7 +194,7 @@ cube ```{r, include=FALSE} end_vignette() -if (run_cleanup) { +if (remake_fixtures) { with_consent({ delete(ds) delete(my_project)