@@ -21,13 +21,13 @@ test_that("medium_bound_imputation follows decision table", {
2121 measurements <- c(- 10 , - 3 , - 2 , - 1 , 0.5 , 1.5 , 3 )
2222 out <- compehndly_apply(
2323 " medium_bound_imputation" ,
24- measurement = polars :: pl $ Series (rep(measurements , 4 )),
25- lod = polars :: pl $ Series (c(rep(NA_real_ , 7 ), rep(1 , 7 ), rep(NA_real_ , 7 ), rep(1 , 7 ))),
26- loq = polars :: pl $ Series (c(rep(NA_real_ , 14 ), rep(2 , 14 )))
24+ measurement = test_series (rep(measurements , 4 )),
25+ lod = test_series (c(rep(NA_real_ , 7 ), rep(1 , 7 ), rep(NA_real_ , 7 ), rep(1 , 7 ))),
26+ loq = test_series (c(rep(NA_real_ , 14 ), rep(2 , 14 )))
2727 )
2828
2929 expect_equal(
30- to_numeric_with_na(out $ to_list( )),
30+ to_numeric_with_na(series_values( out )),
3131 c(
3232 rep(NA_real_ , 7 ),
3333 NA_real_ , NA_real_ , NA_real_ , 0.5 , 0.5 , 1.5 , 3 ,
@@ -43,13 +43,13 @@ test_that("lab_sensitivity_dichotomization follows decision table", {
4343 measurements <- c(- 10 , - 3 , - 2 , - 1 , 0.5 , 1.5 , 3 )
4444 out <- compehndly_apply(
4545 " lab_sensitivity_dichotomization" ,
46- measurement = polars :: pl $ Series (rep(measurements , 4 )),
47- lod = polars :: pl $ Series (c(rep(NA_real_ , 7 ), rep(1 , 7 ), rep(NA_real_ , 7 ), rep(1 , 7 ))),
48- loq = polars :: pl $ Series (c(rep(NA_real_ , 14 ), rep(2 , 14 )))
46+ measurement = test_series (rep(measurements , 4 )),
47+ lod = test_series (c(rep(NA_real_ , 7 ), rep(1 , 7 ), rep(NA_real_ , 7 ), rep(1 , 7 ))),
48+ loq = test_series (c(rep(NA_real_ , 14 ), rep(2 , 14 )))
4949 )
5050
5151 expect_equal(
52- to_logical_with_na(out $ to_list( )),
52+ to_logical_with_na(series_values( out )),
5353 c(
5454 rep(NA , 7 ),
5555 NA , NA , NA , FALSE , FALSE , TRUE , TRUE ,
@@ -65,12 +65,12 @@ test_that("random_single_imputation follows null and bound decisions", {
6565 measurements <- c(- 10 , - 3 , - 2 , - 1 , 0.5 , 1.5 , 3 )
6666 out <- compehndly_apply(
6767 " random_single_imputation" ,
68- biomarker = polars :: pl $ Series (rep(measurements , 4 )),
69- lod = polars :: pl $ Series (c(rep(NA_real_ , 7 ), rep(1 , 7 ), rep(NA_real_ , 7 ), rep(1 , 7 ))),
70- loq = polars :: pl $ Series (c(rep(NA_real_ , 14 ), rep(2 , 14 ))),
68+ biomarker = test_series (rep(measurements , 4 )),
69+ lod = test_series (c(rep(NA_real_ , 7 ), rep(1 , 7 ), rep(NA_real_ , 7 ), rep(1 , 7 ))),
70+ loq = test_series (c(rep(NA_real_ , 14 ), rep(2 , 14 ))),
7171 .params = list (seed = 42 )
7272 )
73- values <- to_numeric_with_na(out $ to_list( ))
73+ values <- to_numeric_with_na(series_values( out ))
7474
7575 expect_true(all(is.na(values [1 : 7 ])))
7676 expect_true(all(is.na(values [8 : 10 ])))
0 commit comments