-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtest_check.R
32 lines (28 loc) · 1.48 KB
/
test_check.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
test_check <- function() {
res <- wrapr::build_frame(
"mean" , "var", "sd" , "naive_var", "naive_sd", "adj_sd" |
1 , 0 , 0 , 0 , 0 , 0.09634 |
1 , 0 , 0 , 0 , 0 , 0.09634 |
1 , 0 , 0 , 0 , 0 , 0.09634 |
1 , 0 , 0 , 0 , 0 , 0.09634 |
0.8 , 0.2 , 0.4472, 0.16 , 0.4 , 0.6016 |
0.8 , 0.2 , 0.4472, 0.16 , 0.4 , 0.6016 |
1 , 0 , 0 , 0 , 0 , 0.09634 |
0.8 , 0.2 , 0.4472, 0.16 , 0.4 , 0.6016 |
0.6 , 0.3 , 0.5477, 0.24 , 0.4899 , 0.4818 |
0.8 , 0.2 , 0.4472, 0.16 , 0.4 , 0.6016 )
cT <- build_unpivot_control(nameForNewKeyColumn = "estimation_method",
nameForNewValueColumn = "sd_estimate",
columnsToTakeFrom = c("adj_sd", "naive_sd"))
expect_error(rp <- rowrecs_to_blocks(res,
controlTable = cT,
checkKeys = TRUE))
d1 <- rowrecs_to_blocks(res,
controlTable = cT)
d2 <- unpivot_to_blocks(res,
nameForNewKeyColumn = "estimation_method",
nameForNewValueColumn = "sd_estimate",
columnsToTakeFrom = c("adj_sd", "naive_sd"))
invisible(NULL)
}
test_check()