Skip to content

Commit 7890ed4

Browse files
committed
add eval = requireNamespace to vignettes
1 parent 878ac4e commit 7890ed4

9 files changed

+13
-13
lines changed

vignettes/teal-modules-general.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ See [package functions / modules](https://insightsengineering.github.io/teal.mod
3939
### Example application
4040

4141
A simple application featuring the `tm_variable_browser()` module:
42-
```{r app, message = FALSE, results = "hide"}
42+
```{r app, message = FALSE, results = "hide", eval = requireNamespace("sparkline")}
4343
# load libraries
4444
library(teal.modules.general)
4545
library(teal.widgets)
@@ -78,7 +78,7 @@ shinyApp(app$ui, app$server)
7878

7979
### Try it out in Shinylive
8080

81-
```{r shinylive_url, echo = FALSE, results = 'asis'}
81+
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
8282
code <- paste0(c(
8383
knitr::knit_code$get("app"),
8484
knitr::knit_code$get("shinyapp")

vignettes/using-association-plot.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))
304304

305305
## 5 - Try it out in Shinylive
306306

307-
```{r shinylive_url, echo = FALSE, results = 'asis'}
307+
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
308308
code <- paste0(c(
309309
knitr::knit_code$get("library"),
310310
knitr::knit_code$get("data"),

vignettes/using-cross-table.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))
147147

148148
## 5 - Try it out in Shinylive
149149

150-
```{r shinylive_url, echo = FALSE, results = 'asis'}
150+
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
151151
code <- paste0(c(
152152
knitr::knit_code$get("library"),
153153
knitr::knit_code$get("data"),

vignettes/using-data-table.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))
117117

118118
## 5 - Try it out in Shinylive
119119

120-
```{r shinylive_url, echo = FALSE, results = 'asis'}
120+
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
121121
code <- paste0(c(
122122
knitr::knit_code$get("library"),
123123
knitr::knit_code$get("data"),

vignettes/using-outliers-module.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))
198198

199199
## 5 - Try it out in Shinylive
200200

201-
```{r shinylive_url, echo = FALSE, results = 'asis'}
201+
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
202202
code <- paste0(c(
203203
knitr::knit_code$get("library"),
204204
knitr::knit_code$get("data"),

vignettes/using-regression-plots.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))
277277

278278
## 5 - Try it out in Shinylive
279279

280-
```{r shinylive_url, echo = FALSE, results = 'asis'}
280+
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
281281
code <- paste0(c(
282282
knitr::knit_code$get("library"),
283283
knitr::knit_code$get("data"),

vignettes/using-response-plot.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))
386386

387387
## 5 - Try it out in Shinylive
388388

389-
```{r shinylive_url, echo = FALSE, results = 'asis'}
389+
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
390390
code <- paste0(c(
391391
knitr::knit_code$get("library"),
392392
knitr::knit_code$get("data"),

vignettes/using-scatterplot-matrix.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))
165165

166166
## 5 - Try it out in Shinylive
167167

168-
```{r shinylive_url, echo = FALSE, results = 'asis'}
168+
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
169169
code <- paste0(c(
170170
knitr::knit_code$get("library"),
171171
knitr::knit_code$get("data"),

vignettes/using-scatterplot.Rmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ various types of datasets using the scatter plot module `tm_g_scatterplot()`:
2121

2222
## 1 - Load libraries
2323

24-
```{r library, echo=TRUE, message=FALSE, warning=FALSE, results="hide"}
24+
```{r library, echo=TRUE, message=FALSE, warning=FALSE, results="hide", eval = requireNamespace("ggpmics") && requireNamespace("ggExtra") && requireNamespace("colourpicker")}
2525
library(teal.modules.general) # used to create the app
2626
library(dplyr) # used to modify data sets
2727
library(ggpmisc)
@@ -38,7 +38,7 @@ Inside this app 4 datasets will be used
3838
3. `ADTTE` A long data set with time to event data
3939
4. `ADLB` A long data set with lab measurements for each subject
4040

41-
```{r data, echo=TRUE, message=FALSE, warning=FALSE, results="hide"}
41+
```{r data, echo=TRUE, message=FALSE, warning=FALSE, results="hide", eval = requireNamespace("ggpmics") && requireNamespace("ggExtra") && requireNamespace("colourpicker")}
4242
data <- teal_data()
4343
data <- within(data, {
4444
ADSL <- teal.modules.general::rADSL %>%
@@ -64,7 +64,7 @@ create an app. The data will be handed over using `teal.data::teal_data()`. The
6464
itself will be constructed by multiple calls of `tm_g_scatterplot()` using different
6565
combinations of data sets.
6666

67-
```{r app, echo=TRUE, message=FALSE, warning=FALSE, results="hide"}
67+
```{r app, echo=TRUE, message=FALSE, warning=FALSE, results="hide", eval = requireNamespace("ggpmics") && requireNamespace("ggExtra") && requireNamespace("colourpicker")}
6868
# configuration for the single wide datasets
6969
mod1 <- tm_g_scatterplot(
7070
label = "Single wide dataset",
@@ -381,7 +381,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))
381381

382382
## 5 - Try it out in Shinylive
383383

384-
```{r shinylive_url, echo = FALSE, results = 'asis'}
384+
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
385385
code <- paste0(c(
386386
knitr::knit_code$get("library"),
387387
knitr::knit_code$get("data"),

0 commit comments

Comments
 (0)