From 0bc196353246f92a8fbcb502ce8736ba95dda594 Mon Sep 17 00:00:00 2001 From: Joe Zhu Date: Fri, 20 Sep 2024 10:00:41 +0800 Subject: [PATCH] resolve green ci (#1293) close #1282 --------- Signed-off-by: Davide Garolini Signed-off-by: Joe Zhu Co-authored-by: Davide Garolini --- DESCRIPTION | 3 ++- tests/testthat/setup.R | 1 - tests/testthat/test-individual_patient_plot.R | 3 +++ vignettes/tables.Rmd | 2 +- vignettes/tern.Rmd | 4 ++-- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3a8c073660..6be9189a3d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -63,7 +63,8 @@ Suggests: testthat (>= 3.1.9), withr (>= 2.0.0) VignetteBuilder: - knitr + knitr, + rmarkdown RdMacros: lifecycle, Rdpack diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index 3a960b45ca..712205d9bb 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -1,6 +1,5 @@ # Extra libraries (suggested) for tests library(dplyr) -library(nestcolor) # skip_if_too_deep skip_if_too_deep <- function(depth) { diff --git a/tests/testthat/test-individual_patient_plot.R b/tests/testthat/test-individual_patient_plot.R index 0262fe2865..48fb863a6c 100644 --- a/tests/testthat/test-individual_patient_plot.R +++ b/tests/testthat/test-individual_patient_plot.R @@ -3,6 +3,9 @@ adlb <- tern_ex_adlb %>% slice(1:36) testthat::test_that("h_g_ipp works correctly", { + skip_if_not_installed("nestcolor") + require("nestcolor", quietly = TRUE) + testthat::expect_silent(h_g_ipp( df = adlb, xvar = "AVISIT", diff --git a/vignettes/tables.Rmd b/vignettes/tables.Rmd index 9feba45514..89e00d89ac 100644 --- a/vignettes/tables.Rmd +++ b/vignettes/tables.Rmd @@ -54,7 +54,7 @@ The table layout is materialized with the `rtables::build_table` function and th The `tern` analyze functions are wrappers around `rtables::analyze` function, they offer various methods useful from the perspective of clinical trials and other statistical projects. Examples of the `tern` analyze functions are `count_occurrences`, `summarize_ancova` or `analyze_vars`. -As there is no one prefix to identify all `tern` analyze functions it is recommended to use the [the tern website functions reference](https://insightsengineering.github.io/tern/main/reference/index.html). +As there is no one prefix to identify all `tern` analyze functions it is recommended to use the [the tern website functions reference](https://insightsengineering.github.io/tern/latest-tag/reference/index.html). ### Internals of `tern` Analyze Functions diff --git a/vignettes/tern.Rmd b/vignettes/tern.Rmd index 0920bff77d..e30d456b16 100644 --- a/vignettes/tern.Rmd +++ b/vignettes/tern.Rmd @@ -69,7 +69,7 @@ data visualizations helper functions: - ... -The reference of `tern` functions is available on [the tern website functions reference](https://insightsengineering.github.io/tern/main/reference/index.html). +The reference of `tern` functions is available on [the tern website functions reference](https://insightsengineering.github.io/tern/latest-tag/reference/index.html). --------- @@ -82,7 +82,7 @@ The table layout is materialized with the `rtables::build_table` function and th The `tern` analytical functions are wrappers around the `rtables::analyze` function; they offer various methods useful from the perspective of clinical trials and other statistical projects. Examples of the `tern` analytical functions are `count_occurrences`, `summarize_ancova` and `analyze_vars`. -As there is no one prefix to identify all `tern` analytical functions it is recommended to use the reference subsection on [the tern website](https://insightsengineering.github.io/tern/main/reference/index.html). +As there is no one prefix to identify all `tern` analytical functions it is recommended to use the reference subsection on [the tern website](https://insightsengineering.github.io/tern/latest-tag/reference/index.html). In the `rtables` code below we first describe the two tables and assign the descriptions to the variables `lyt` and `lyt2`. We then built the tables using the actual data with `rtables::build_table`. The description of a table is called a table **layout**. The **analyze instruction** adds to the layout that the `ARM` variable should be analyzed with the `mean` analysis function and the result should be rounded to 1 decimal place. Hence, a **layout** is “pre-data”; that is, it’s a description of **how to build a table once we get data**.