Skip to content

Commit 3fd7220

Browse files
committed
fix test
1 parent f4e22f3 commit 3fd7220

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tests/testthat/test-check_group_variation.R

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ test_that("check_group_variation-2", {
8989

9090
skip_if_not_installed("parameters")
9191
data(qol_cancer, package = "parameters")
92+
d <- qol_cancer
9293
out <- check_group_variation(
93-
qol_cancer,
94+
d,
9495
select = c("age", "phq4", "QoL", "education"),
9596
by = "ID"
9697
)
@@ -104,25 +105,25 @@ test_that("check_group_variation-2", {
104105
ignore_attr = TRUE
105106
)
106107

107-
data(qol_cancer, package = "parameters")
108-
qol_cancer <- datawizard::demean(qol_cancer, select = "phq4", by = "ID")
108+
d <- qol_cancer
109+
d <- datawizard::demean(d, select = "phq4", by = "ID")
109110
expect_error(
110111
check_group_variation(
111-
qol_cancer,
112+
d,
112113
select = c("phq4", "phq4_within", "phq4_between"),
113114
by = "ID"
114115
),
115116
regex = "One or more"
116117
)
117118

118-
data(qol_cancer, package = "parameters")
119-
qol_cancer <- datawizard::demean(qol_cancer, select = "phq4", by = "ID")
120-
qol_cancer <- datawizard::data_rename(
121-
qol_cancer,
119+
d <- qol_cancer
120+
d <- datawizard::demean(d, select = "phq4", by = "ID")
121+
d <- datawizard::data_rename(
122+
d,
122123
select = c(phq4w = "phq4_within", phq4b = "phq4_between")
123124
)
124125
out <- check_group_variation(
125-
qol_cancer,
126+
d,
126127
select = c("age", "phq4", "QoL", "education", "phq4w", "phq4b"),
127128
by = "ID"
128129
)

0 commit comments

Comments
 (0)