Skip to content

Commit

Permalink
add eval = requireNamespace to vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
m7pr committed Oct 4, 2024
1 parent 878ac4e commit 7890ed4
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions vignettes/teal-modules-general.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ See [package functions / modules](https://insightsengineering.github.io/teal.mod
### Example application

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

### Try it out in Shinylive

```{r shinylive_url, echo = FALSE, results = 'asis'}
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
code <- paste0(c(
knitr::knit_code$get("app"),
knitr::knit_code$get("shinyapp")
Expand Down
2 changes: 1 addition & 1 deletion vignettes/using-association-plot.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))

## 5 - Try it out in Shinylive

```{r shinylive_url, echo = FALSE, results = 'asis'}
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
code <- paste0(c(
knitr::knit_code$get("library"),
knitr::knit_code$get("data"),
Expand Down
2 changes: 1 addition & 1 deletion vignettes/using-cross-table.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))

## 5 - Try it out in Shinylive

```{r shinylive_url, echo = FALSE, results = 'asis'}
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
code <- paste0(c(
knitr::knit_code$get("library"),
knitr::knit_code$get("data"),
Expand Down
2 changes: 1 addition & 1 deletion vignettes/using-data-table.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))

## 5 - Try it out in Shinylive

```{r shinylive_url, echo = FALSE, results = 'asis'}
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
code <- paste0(c(
knitr::knit_code$get("library"),
knitr::knit_code$get("data"),
Expand Down
2 changes: 1 addition & 1 deletion vignettes/using-outliers-module.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))

## 5 - Try it out in Shinylive

```{r shinylive_url, echo = FALSE, results = 'asis'}
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
code <- paste0(c(
knitr::knit_code$get("library"),
knitr::knit_code$get("data"),
Expand Down
2 changes: 1 addition & 1 deletion vignettes/using-regression-plots.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))

## 5 - Try it out in Shinylive

```{r shinylive_url, echo = FALSE, results = 'asis'}
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
code <- paste0(c(
knitr::knit_code$get("library"),
knitr::knit_code$get("data"),
Expand Down
2 changes: 1 addition & 1 deletion vignettes/using-response-plot.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))

## 5 - Try it out in Shinylive

```{r shinylive_url, echo = FALSE, results = 'asis'}
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
code <- paste0(c(
knitr::knit_code$get("library"),
knitr::knit_code$get("data"),
Expand Down
2 changes: 1 addition & 1 deletion vignettes/using-scatterplot-matrix.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ shinyApp(app$ui, app$server, options = list(height = 1024, width = 1024))

## 5 - Try it out in Shinylive

```{r shinylive_url, echo = FALSE, results = 'asis'}
```{r shinylive_url, echo = FALSE, results = 'asis', eval = requireNamespace("roxy.shinylive")}
code <- paste0(c(
knitr::knit_code$get("library"),
knitr::knit_code$get("data"),
Expand Down
8 changes: 4 additions & 4 deletions vignettes/using-scatterplot.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ various types of datasets using the scatter plot module `tm_g_scatterplot()`:

## 1 - Load libraries

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

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

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

## 5 - Try it out in Shinylive

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

0 comments on commit 7890ed4

Please sign in to comment.