Skip to content

Commit c605edf

Browse files
committed
no suggests for the survival package
1 parent 4688ab7 commit c605edf

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

tests/testthat/helper-objects.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,17 @@ if (rlang::is_installed("modeldata")) {
113113
}
114114
}
115115

116+
if (rlang::is_installed("survival")) {
117+
data(cancer, package = "survival")
118+
basic_form <- survival::Surv(time, status) ~ age
119+
complete_form <- survival::Surv(time) ~ age
120+
121+
if (R.Version()$major < "4") {
122+
data(lung, package = 'survival')
123+
} else {
124+
data(cancer, package = 'survival')
125+
}
126+
127+
basic_form <- survival::Surv(time, status) ~ group
128+
complete_form <- survival::Surv(time) ~ group
129+
}

tests/testthat/test-surv_reg_flexsurv.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
data(cancer, package = "survival")
21

3-
basic_form <- survival::Surv(time, status) ~ age
4-
complete_form <- survival::Surv(time) ~ age
52

63
# ------------------------------------------------------------------------------
74

85
test_that('flexsurv execution', {
96
skip_if_not_installed("flexsurv")
7+
skip_if_not_installed("survival")
108

119
rlang::local_options(lifecycle_verbosity = "quiet")
1210
surv_basic <- surv_reg() |> set_engine("flexsurv")
@@ -43,6 +41,8 @@ test_that('flexsurv execution', {
4341

4442
test_that('flexsurv prediction', {
4543
skip_if_not_installed("flexsurv")
44+
skip_if_not_installed("survival")
45+
4646

4747
rlang::local_options(lifecycle_verbosity = "quiet")
4848
surv_basic <- surv_reg() |> set_engine("flexsurv")

tests/testthat/test-surv_reg_survreg.R

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
if (R.Version()$major < "4") {
2-
data(lung, package = 'survival')
3-
} else {
4-
data(cancer, package = 'survival')
5-
}
61

7-
basic_form <- survival::Surv(time, status) ~ group
8-
complete_form <- survival::Surv(time) ~ group
92

103
# ------------------------------------------------------------------------------
114

0 commit comments

Comments
 (0)