Skip to content

Commit 2926b7f

Browse files
committed
Do not evaluate vignettes if cairo is not available
1 parent 19ca6d8 commit 2926b7f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

vignettes/converting.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ knitr::opts_chunk$set(
1414
)
1515
1616
should_run_benchmarks <- function(x) {
17-
get("requireNamespace")("cpp11test") && asNamespace("cpp11test")$should_run_benchmarks()
17+
get("requireNamespace")("cpp11test", quietly = TRUE) && asNamespace("cpp11test")$should_run_benchmarks()
1818
}
1919
```
2020

@@ -112,7 +112,7 @@ b_grow <- bench::press(.grid = grid,
112112
saveRDS(b_grow, "growth.Rds", version = 2)
113113
```
114114

115-
```{r, echo = FALSE, dev = "svg", fig.ext = "svg"}
115+
```{r, echo = FALSE, dev = "svg", fig.ext = "svg", eval = capabilities("cairo")}
116116
b_grow <- readRDS("growth.Rds")
117117
library(ggplot2)
118118
ggplot(b_grow, aes(x = len, y = min, color = pkg)) +

vignettes/motivations.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ print_cpp <- function(filename) {
2121
library(cpp11)
2222
2323
should_run_benchmarks <- function(x) {
24-
get("requireNamespace")("cpp11test") && asNamespace("cpp11test")$should_run_benchmarks()
24+
get("requireNamespace")("cpp11test", quietly = TRUE) && asNamespace("cpp11test")$should_run_benchmarks()
2525
}
2626
```
2727

@@ -445,7 +445,7 @@ b_release <- bench::press(.grid = grid,
445445
saveRDS(b_release, "release.Rds", version = 2)
446446
```
447447

448-
```{r, echo = FALSE, dev = "svg", fig.ext = "svg"}
448+
```{r, echo = FALSE, dev = "svg", fig.ext = "svg", eval = capabilities("cairo")}
449449
b_release <- readRDS("release.Rds")
450450
library(ggplot2)
451451
ggplot(b_release, aes(x = len, y = min / len, color = pkg)) +
@@ -493,7 +493,7 @@ b_grow <- bench::press(.grid = grid,
493493
saveRDS(b_grow, "growth.Rds", version = 2)
494494
```
495495

496-
```{r, echo = FALSE, dev = "svg", fig.ext = "svg"}
496+
```{r, echo = FALSE, dev = "svg", fig.ext = "svg", eval = capabilities("cairo")}
497497
b_grow <- readRDS("growth.Rds")
498498
library(ggplot2)
499499
ggplot(b_grow, aes(x = len, y = min, color = pkg)) +

0 commit comments

Comments
 (0)