Skip to content

Commit c068150

Browse files
authored
namespace slice() (#213)
1 parent 23879ae commit c068150

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

tests/testthat/test-parsnip-survival-censoring-weights.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ test_that('compute Graf weights', {
150150
predict(mod_fit, df, type = "time"),
151151
df
152152
) %>%
153-
slice(5)
153+
dplyr::slice(5)
154154

155155
wt_times <-
156156
parsnip:::graf_weight_time_vec(pred_surv$surv,

tests/testthat/test-survival-tune-grid.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ test_that("grid tuning survival models with static metric", {
124124
concordance_survival = numeric(0)
125125
)
126126

127-
expect_equal(metric_all %>% slice(), exp_metric_all)
127+
expect_equal(metric_all %>% dplyr::slice(), exp_metric_all)
128128
})
129129

130130
test_that("grid tuning survival models with integrated metric", {
@@ -268,7 +268,7 @@ test_that("grid tuning survival models with integrated metric", {
268268
brier_survival_integrated = numeric(0)
269269
)
270270

271-
expect_equal(metric_all %>% slice(), exp_metric_all)
271+
expect_equal(metric_all %>% dplyr::slice(), exp_metric_all)
272272
})
273273

274274
test_that("grid tuning survival models with dynamic metric", {
@@ -422,7 +422,7 @@ test_that("grid tuning survival models with dynamic metric", {
422422
brier_survival = numeric(0)
423423
)
424424

425-
expect_equal(metric_all %>% slice(), exp_metric_all)
425+
expect_equal(metric_all %>% dplyr::slice(), exp_metric_all)
426426
})
427427

428428
test_that("grid tuning survival models mixture of metric types", {
@@ -593,5 +593,5 @@ test_that("grid tuning survival models mixture of metric types", {
593593
brier_survival = numeric(0)
594594
)
595595

596-
expect_equal(metric_all %>% slice(), exp_metric_all)
596+
expect_equal(metric_all %>% dplyr::slice(), exp_metric_all)
597597
})

tests/testthat/test-survival-tune-show-best.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ test_that("show_best with censored data - dynamic metric - bayes", {
7070
bayes_dyn_res %>%
7171
collect_metrics() %>%
7272
arrange(mean) %>%
73-
slice(1:2)
73+
dplyr::slice(1:2)
7474
)
7575
expect_snapshot(
7676
show_best(bayes_dyn_res)
@@ -119,7 +119,7 @@ test_that("show_best with censored data - static metric - anova racing", {
119119
count(.config) %>%
120120
filter(n == num_rs) %>%
121121
arrange(.config) %>%
122-
slice(1) %>%
122+
dplyr::slice(1) %>%
123123
pluck(".config")
124124

125125
expect_equal(
@@ -178,7 +178,7 @@ test_that("show_best with censored data - static metric (+dyn) - W/L racing", {
178178
collect_metrics() %>%
179179
filter(.metric == "concordance_survival" & n == num_rs) %>%
180180
arrange(desc(mean)) %>%
181-
slice(1:5) %>%
181+
dplyr::slice(1:5) %>%
182182
pluck(".config")
183183

184184
expect_equal(
@@ -241,7 +241,7 @@ test_that("show_best with censored data - dyn metric (+stc) - W/L racing", {
241241
collect_metrics() %>%
242242
filter(.metric == "brier_survival" & n == num_rs) %>%
243243
arrange(mean) %>%
244-
slice(1:5) %>%
244+
dplyr::slice(1:5) %>%
245245
pluck(".config")
246246

247247
expect_equal(

tests/testthat/test-survival-tune_race_anova.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ test_that("race tuning (anova) survival models with static metric", {
205205
concordance_survival = numeric(0)
206206
)
207207

208-
expect_equal(metric_all %>% slice(), exp_metric_all)
208+
expect_equal(metric_all %>% dplyr::slice(), exp_metric_all)
209209
})
210210

211211
test_that("race tuning (anova) survival models with integrated metric", {
@@ -435,7 +435,7 @@ test_that("race tuning (anova) survival models with integrated metric", {
435435
brier_survival_integrated = numeric(0)
436436
)
437437

438-
expect_equal(metric_all %>% slice(), exp_metric_all)
438+
expect_equal(metric_all %>% dplyr::slice(), exp_metric_all)
439439
})
440440

441441
test_that("race tuning (anova) survival models with dynamic metrics", {
@@ -682,7 +682,7 @@ test_that("race tuning (anova) survival models with dynamic metrics", {
682682
brier_survival = numeric(0)
683683
)
684684

685-
expect_equal(metric_all %>% slice(), exp_metric_all)
685+
expect_equal(metric_all %>% dplyr::slice(), exp_metric_all)
686686
})
687687

688688
test_that("race tuning (anova) survival models with mixture of metric types", {
@@ -1036,7 +1036,7 @@ test_that("race tuning (anova) survival models with mixture of metric types", {
10361036
concordance_survival = numeric(0)
10371037
)
10381038

1039-
expect_equal(metric_all %>% slice(), exp_metric_all)
1039+
expect_equal(metric_all %>% dplyr::slice(), exp_metric_all)
10401040
})
10411041

10421042
test_that("race tuning (anova) - unneeded eval_time", {

tests/testthat/test-survival-tune_race_win_loss.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ test_that("race tuning (win_loss) survival models with static metric", {
203203
concordance_survival = numeric(0)
204204
)
205205

206-
expect_equal(metric_all %>% slice(), exp_metric_all)
206+
expect_equal(metric_all %>% dplyr::slice(), exp_metric_all)
207207

208208
})
209209

@@ -433,7 +433,7 @@ test_that("race tuning (win_loss) survival models with integrated metric", {
433433
brier_survival_integrated = numeric(0)
434434
)
435435

436-
expect_equal(metric_all %>% slice(), exp_metric_all)
436+
expect_equal(metric_all %>% dplyr::slice(), exp_metric_all)
437437
})
438438

439439
test_that("race tuning (win_loss) survival models with dynamic metrics", {
@@ -666,7 +666,7 @@ test_that("race tuning (win_loss) survival models with dynamic metrics", {
666666
brier_survival = numeric(0)
667667
)
668668

669-
expect_equal(metric_all %>% slice(), exp_metric_all)
669+
expect_equal(metric_all %>% dplyr::slice(), exp_metric_all)
670670
})
671671

672672
test_that("race tuning (win_loss) survival models with mixture of metric types", {
@@ -1017,7 +1017,7 @@ test_that("race tuning (win_loss) survival models with mixture of metric types",
10171017
concordance_survival = numeric(0)
10181018
)
10191019

1020-
expect_equal(metric_all %>% slice(), exp_metric_all)
1020+
expect_equal(metric_all %>% dplyr::slice(), exp_metric_all)
10211021
})
10221022

10231023

0 commit comments

Comments
 (0)