diff --git a/tests/testthat/_snaps/derive_vars_cat.md b/tests/testthat/_snaps/derive_vars_cat.md index 362a5f75d..372243c03 100644 --- a/tests/testthat/_snaps/derive_vars_cat.md +++ b/tests/testthat/_snaps/derive_vars_cat.md @@ -1,189 +1,15 @@ -# derive_vars_cat Test 1: Basic functionality with advs dataset - - Code - result - Output - # A tibble: 20 x 5 - USUBJID VSTEST AVAL AVALCAT1 AVALCA1N - - 1 01-701-1015 Height 147. <160 2 - 2 01-701-1023 Height 163. >=160 1 - 3 01-701-1028 Height 178. >=160 1 - 4 01-701-1033 Height 175. >=160 1 - 5 01-701-1034 Height NA NA - 6 01-701-1047 Height NA NA - 7 01-701-1097 Height 169. >=160 1 - 8 01-701-1111 Height 158. <160 2 - 9 01-701-1115 Height 182. >=160 1 - 10 01-701-1118 Height 180. >=160 1 - 11 01-701-1015 Weight 54.0 NA - 12 01-701-1023 Weight 78.5 NA - 13 01-701-1028 Weight 98.9 NA - 14 01-701-1033 Weight 88.4 NA - 15 01-701-1034 Weight NA NA - 16 01-701-1047 Weight NA NA - 17 01-701-1097 Weight 78.0 NA - 18 01-701-1111 Weight 60.3 NA - 19 01-701-1115 Weight 78.7 NA - 20 01-701-1118 Weight 71.7 NA - ---- - - Code - result2 - Output - # A tibble: 20 x 5 - USUBJID VSTEST AVAL AVALCAT1 AVALCA1N - - 1 01-701-1015 Height 147. <160 2 - 2 01-701-1023 Height 163. >=160 1 - 3 01-701-1028 Height 178. >=160 1 - 4 01-701-1033 Height 175. >=160 1 - 5 01-701-1034 Height NA NA - 6 01-701-1047 Height NA NA - 7 01-701-1097 Height 169. >=160 1 - 8 01-701-1111 Height 158. <160 2 - 9 01-701-1115 Height 182. >=160 1 - 10 01-701-1118 Height 180. >=160 1 - 11 01-701-1015 Weight 54.0 NA - 12 01-701-1023 Weight 78.5 NA - 13 01-701-1028 Weight 98.9 NA - 14 01-701-1033 Weight 88.4 NA - 15 01-701-1034 Weight NA NA - 16 01-701-1047 Weight NA NA - 17 01-701-1097 Weight 78.0 NA - 18 01-701-1111 Weight 60.3 NA - 19 01-701-1115 Weight 78.7 NA - 20 01-701-1118 Weight 71.7 NA - -# derive_vars_cat Test 2: Forgot to specify by_vars +# derive_vars_cat Test 3: Forgot to specify by_vars Column(s) in `definition` already exist in `dataset`. Did you forget to specify `by_vars`, or are you rerunning your code? -# derive_vars_cat Test 4: Error when definition is not an exprs object +# derive_vars_cat Test 5: Error when definition is not an exprs object Argument `definition` must be a list of expressions but is a tibble. i To create a list of expressions use `exprs()`. -# derive_vars_cat Test 6: Correct behavior when no conditions are met - - Code - result - Output - # A tibble: 20 x 5 - USUBJID VSTEST AVAL AVALCAT1 AVALCA1N - - 1 01-701-1015 Height 147. NA - 2 01-701-1023 Height 163. NA - 3 01-701-1028 Height 178. NA - 4 01-701-1033 Height 175. NA - 5 01-701-1034 Height NA NA - 6 01-701-1047 Height NA NA - 7 01-701-1097 Height 169. NA - 8 01-701-1111 Height 158. NA - 9 01-701-1115 Height 182. NA - 10 01-701-1118 Height 180. NA - 11 01-701-1015 Weight 54.0 NA - 12 01-701-1023 Weight 78.5 NA - 13 01-701-1028 Weight 98.9 NA - 14 01-701-1033 Weight 88.4 NA - 15 01-701-1034 Weight NA NA - 16 01-701-1047 Weight NA NA - 17 01-701-1097 Weight 78.0 NA - 18 01-701-1111 Weight 60.3 NA - 19 01-701-1115 Weight 78.7 NA - 20 01-701-1118 Weight 71.7 NA - -# derive_vars_cat Test 7: Overlapping conditions handled correctly - - Code - result - Output - # A tibble: 20 x 5 - USUBJID VSTEST AVAL AVALCAT1 AVALCA1N - - 1 01-701-1015 Height 147. <160 3 - 2 01-701-1023 Height 163. <170 2 - 3 01-701-1028 Height 178. >=170 1 - 4 01-701-1033 Height 175. >=170 1 - 5 01-701-1034 Height NA NA - 6 01-701-1047 Height NA NA - 7 01-701-1097 Height 169. <170 2 - 8 01-701-1111 Height 158. <160 3 - 9 01-701-1115 Height 182. >=170 1 - 10 01-701-1118 Height 180. >=170 1 - 11 01-701-1015 Weight 54.0 NA - 12 01-701-1023 Weight 78.5 NA - 13 01-701-1028 Weight 98.9 NA - 14 01-701-1033 Weight 88.4 NA - 15 01-701-1034 Weight NA NA - 16 01-701-1047 Weight NA NA - 17 01-701-1097 Weight 78.0 NA - 18 01-701-1111 Weight 60.3 NA - 19 01-701-1115 Weight 78.7 NA - 20 01-701-1118 Weight 71.7 NA - -# derive_vars_cat Test 9: Conditions for multiple VSTESTs (Height and Weight) - - Code - result - Output - # A tibble: 20 x 5 - USUBJID VSTEST AVAL AVALCAT1 AVALCA1N - - 1 01-701-1015 Height 147. Height < 160 2 - 2 01-701-1023 Height 163. Height >= 160 1 - 3 01-701-1028 Height 178. Height >= 160 1 - 4 01-701-1033 Height 175. Height >= 160 1 - 5 01-701-1034 Height NA NA - 6 01-701-1047 Height NA NA - 7 01-701-1097 Height 169. Height >= 160 1 - 8 01-701-1111 Height 158. Height < 160 2 - 9 01-701-1115 Height 182. Height >= 160 1 - 10 01-701-1118 Height 180. Height >= 160 1 - 11 01-701-1015 Weight 54.0 Weight < 66.68 2 - 12 01-701-1023 Weight 78.5 Weight >= 66.68 1 - 13 01-701-1028 Weight 98.9 Weight >= 66.68 1 - 14 01-701-1033 Weight 88.4 Weight >= 66.68 1 - 15 01-701-1034 Weight NA NA - 16 01-701-1047 Weight NA NA - 17 01-701-1097 Weight 78.0 Weight >= 66.68 1 - 18 01-701-1111 Weight 60.3 Weight < 66.68 2 - 19 01-701-1115 Weight 78.7 Weight >= 66.68 1 - 20 01-701-1118 Weight 71.7 Weight >= 66.68 1 - -# derive_vars_cat Test 10: Adding an extra variable (flag) to the dataset - - Code - result - Output - # A tibble: 20 x 6 - USUBJID VSTEST AVAL AVALCAT1 AVALCA1N extra_var - - 1 01-701-1015 Height 147. <160 2 FALSE - 2 01-701-1023 Height 163. >=160 1 TRUE - 3 01-701-1028 Height 178. >=160 1 TRUE - 4 01-701-1033 Height 175. >=160 1 TRUE - 5 01-701-1034 Height NA NA NA - 6 01-701-1047 Height NA NA NA - 7 01-701-1097 Height 169. >=160 1 TRUE - 8 01-701-1111 Height 158. <160 2 FALSE - 9 01-701-1115 Height 182. >=160 1 TRUE - 10 01-701-1118 Height 180. >=160 1 TRUE - 11 01-701-1015 Weight 54.0 NA NA - 12 01-701-1023 Weight 78.5 NA NA - 13 01-701-1028 Weight 98.9 NA NA - 14 01-701-1033 Weight 88.4 NA NA - 15 01-701-1034 Weight NA NA NA - 16 01-701-1047 Weight NA NA NA - 17 01-701-1097 Weight 78.0 NA NA - 18 01-701-1111 Weight 60.3 NA NA - 19 01-701-1115 Weight 78.7 NA NA - 20 01-701-1118 Weight 71.7 NA NA - -# derive_vars_cat Test 12: definition has wrong shape +# derive_vars_cat Test 13: definition has wrong shape Failed to convert `definition` to `tibble`. `definition` should be specified similarly to how you would specify a `tibble` using the `tribble()` function so it can be converted to `tibble` using `tribble()`. diff --git a/tests/testthat/test-derive_vars_cat.R b/tests/testthat/test-derive_vars_cat.R index 4cca9989f..42b70fa82 100644 --- a/tests/testthat/test-derive_vars_cat.R +++ b/tests/testthat/test-derive_vars_cat.R @@ -23,8 +23,31 @@ advs <- tibble::tribble( "01-701-1118", "Weight", 71.67 ) %>% arrange(VSTEST) -## Test 1: Basic functionality with advs dataset ---- -test_that("derive_vars_cat Test 1: Basic functionality with advs dataset", { +expected_result <- tibble::tribble( + ~USUBJID, ~VSTEST, ~AVAL, ~AVALCAT1, ~AVALCA1N, + "01-701-1015", "Height", 147.32, "<160", 2, + "01-701-1023", "Height", 162.56, ">=160", 1, + "01-701-1028", "Height", 177.8, ">=160", 1, + "01-701-1033", "Height", 175.26, ">=160", 1, + "01-701-1034", "Height", NA, NA, NA, + "01-701-1047", "Height", NA, NA, NA, + "01-701-1097", "Height", 168.91, ">=160", 1, + "01-701-1111", "Height", 158.24, "<160", 2, + "01-701-1115", "Height", 181.61, ">=160", 1, + "01-701-1118", "Height", 180.34, ">=160", 1, + "01-701-1015", "Weight", 53.98, NA, NA, + "01-701-1023", "Weight", 78.47, NA, NA, + "01-701-1028", "Weight", 98.88, NA, NA, + "01-701-1033", "Weight", 88.45, NA, NA, + "01-701-1034", "Weight", NA, NA, NA, + "01-701-1047", "Weight", NA, NA, NA, + "01-701-1097", "Weight", 78.02, NA, NA, + "01-701-1111", "Weight", 60.33, NA, NA, + "01-701-1115", "Weight", 78.7, NA, NA, + "01-701-1118", "Weight", 71.67, NA, NA +) +## Test 1: Basic functionality without by_vars ---- +test_that("derive_vars_cat Test 1: Basic functionality without by_vars", { # Define the condition and categories definition <- exprs( ~condition, ~AVALCAT1, ~AVALCA1N, @@ -32,24 +55,36 @@ test_that("derive_vars_cat Test 1: Basic functionality with advs dataset", { VSTEST == "Height" & AVAL < 160, "<160", 2 ) - result <- derive_vars_cat(advs, definition) + expect_dfs_equal(base = + derive_vars_cat( + advs, + definition), + compare = expected_result, + keys = c("USUBJID", "VSTEST")) +}) - # using by_vars - definition2 <- exprs( +## Test 2: Basic functionality with by_vars ---- +test_that("derive_vars_cat Test 2: Basic functionality with by_vars", { + # Define the condition and categories + definition <- exprs( ~VSTEST, ~condition, ~AVALCAT1, ~AVALCA1N, "Height", AVAL >= 160, ">=160", 1, "Height", AVAL < 160, "<160", 2 ) - result2 <- derive_vars_cat(advs, definition2, by_vars = exprs(VSTEST)) - expect_snapshot(result) - expect_snapshot(result2) - expect_dfs_equal(base = result, compare = result2, keys = c("USUBJID", "VSTEST")) + + expect_dfs_equal(base = + derive_vars_cat( + advs, + definition, + by_vars = exprs(VSTEST)), + compare = expected_result, + keys = c("USUBJID", "VSTEST")) }) -## Test 2: Forgot to specify by_vars ---- -test_that("derive_vars_cat Test 2: Forgot to specify by_vars", { +## Test 3: Forgot to specify by_vars ---- +test_that("derive_vars_cat Test 3: Forgot to specify by_vars", { definition <- exprs( ~VSTEST, ~condition, ~AVALCAT1, ~AVALCA1N, "Height", AVAL >= 160, ">=160", 1, @@ -59,8 +94,8 @@ test_that("derive_vars_cat Test 2: Forgot to specify by_vars", { expect_snapshot_warning(derive_vars_cat(advs, definition)) }) -## Test 3: Error when dataset is not a dataframe ---- -test_that("derive_vars_cat Test 3: Error when dataset is not a dataframe", { +## Test 4: Error when dataset is not a dataframe ---- +test_that("derive_vars_cat Test 4: Error when dataset is not a dataframe", { # Define the condition and categories definition <- exprs( ~condition, ~AVALCAT1, ~AVALCA1N, @@ -75,8 +110,8 @@ test_that("derive_vars_cat Test 3: Error when dataset is not a dataframe", { ) }) -## Test 4: Error when definition is not an exprs object ---- -test_that("derive_vars_cat Test 4: Error when definition is not an exprs object", { +## Test 5: Error when definition is not an exprs object ---- +test_that("derive_vars_cat Test 5: Error when definition is not an exprs object", { definition <- tribble( ~condition, ~AVALCAT1, ~AVALCA1N, "AVAL >= 160", ">=160", 1, @@ -88,8 +123,8 @@ test_that("derive_vars_cat Test 4: Error when definition is not an exprs object" ) }) -## Test 5: Error when required columns are missing from dataset ---- -test_that("derive_vars_cat Test 5: Error when required columns are missing from dataset", { +## Test 6: Error when required columns are missing from dataset ---- +test_that("derive_vars_cat Test 6: Error when required columns are missing from dataset", { # Define the condition and categories (without VSTEST in the dataset) definition <- exprs( ~VSTEST, ~condition, ~AVALCAT1, ~AVALCA1N, @@ -107,21 +142,45 @@ test_that("derive_vars_cat Test 5: Error when required columns are missing from ) }) -## Test 6: Correct behavior when no conditions are met ---- -test_that("derive_vars_cat Test 6: Correct behavior when no conditions are met", { +## Test 7: Correct behavior when no conditions are met ---- +test_that("derive_vars_cat Test 7: Correct behavior when no conditions are met", { # Define conditions that do not match any rows definition <- exprs( ~condition, ~AVALCAT1, ~AVALCA1N, VSTEST == "Height" & AVAL < 0, "<0", 1 ) - result <- derive_vars_cat(advs, definition) + expected_result <- tibble::tribble( + ~USUBJID, ~VSTEST, ~AVAL, ~AVALCAT1, ~AVALCA1N, + "01-701-1015", "Height", 147.32, NA_character_, NA_real_, + "01-701-1023", "Height", 162.56, NA_character_, NA_real_, + "01-701-1028", "Height", 177.8, NA_character_, NA_real_, + "01-701-1033", "Height", 175.26, NA_character_, NA_real_, + "01-701-1034", "Height", NA, NA_character_, NA_real_, + "01-701-1047", "Height", NA, NA_character_, NA_real_, + "01-701-1097", "Height", 168.91, NA_character_, NA_real_, + "01-701-1111", "Height", 158.24, NA_character_, NA_real_, + "01-701-1115", "Height", 181.61, NA_character_, NA_real_, + "01-701-1118", "Height", 180.34, NA_character_, NA_real_, + "01-701-1015", "Weight", 53.98, NA_character_, NA_real_, + "01-701-1023", "Weight", 78.47, NA_character_, NA_real_, + "01-701-1028", "Weight", 98.88, NA_character_, NA_real_, + "01-701-1033", "Weight", 88.45, NA_character_, NA_real_, + "01-701-1034", "Weight", NA, NA_character_, NA_real_, + "01-701-1047", "Weight", NA, NA_character_, NA_real_, + "01-701-1097", "Weight", 78.02, NA_character_, NA_real_, + "01-701-1111", "Weight", 60.33, NA_character_, NA_real_, + "01-701-1115", "Weight", 78.7, NA_character_, NA_real_, + "01-701-1118", "Weight", 71.67, NA_character_, NA_real_ + ) - expect_snapshot(result) + expect_dfs_equal(base = derive_vars_cat(advs, definition), + compare = expected_result, + keys = c("USUBJID", "VSTEST")) }) -## Test 7: Overlapping conditions handled correctly ---- -test_that("derive_vars_cat Test 7: Overlapping conditions handled correctly", { +## Test 8: Overlapping conditions handled correctly ---- +test_that("derive_vars_cat Test 8: Overlapping conditions handled correctly", { # Define overlapping conditions definition <- exprs( ~VSTEST, ~condition, ~AVALCAT1, ~AVALCA1N, @@ -130,14 +189,38 @@ test_that("derive_vars_cat Test 7: Overlapping conditions handled correctly", { "Height", AVAL >= 170, ">=170", 1 ) - result <- derive_vars_cat(advs, definition, by_vars = exprs(VSTEST)) + expected_result <- tibble::tribble( + ~USUBJID, ~VSTEST, ~AVAL, ~AVALCAT1, ~AVALCA1N, + "01-701-1015", "Height", 147.32, "<160", 3, + "01-701-1023", "Height", 162.56, "<170", 2, + "01-701-1028", "Height", 177.8, ">=170", 1, + "01-701-1033", "Height", 175.26, ">=170", 1, + "01-701-1034", "Height", NA, NA, NA, + "01-701-1047", "Height", NA, NA, NA, + "01-701-1097", "Height", 168.91, "<170", 2, + "01-701-1111", "Height", 158.24, "<160", 3, + "01-701-1115", "Height", 181.61, ">=170", 1, + "01-701-1118", "Height", 180.34, ">=170", 1, + "01-701-1015", "Weight", 53.98, NA, NA, + "01-701-1023", "Weight", 78.47, NA, NA, + "01-701-1028", "Weight", 98.88, NA, NA, + "01-701-1033", "Weight", 88.45, NA, NA, + "01-701-1034", "Weight", NA, NA, NA, + "01-701-1047", "Weight", NA, NA, NA, + "01-701-1097", "Weight", 78.02, NA, NA, + "01-701-1111", "Weight", 60.33, NA, NA, + "01-701-1115", "Weight", 78.7, NA, NA, + "01-701-1118", "Weight", 71.67, NA, NA + ) - expect_snapshot(result) + expect_dfs_equal(base = derive_vars_cat(advs, definition, by_vars = exprs(VSTEST)), + compare = expected_result, + keys = c("USUBJID", "VSTEST")) }) -## Test 8: Error when condition is missing from `definition` ---- -test_that("derive_vars_cat Test 8: Error when condition is missing from `definition`", { +## Test 9: Error when condition is missing from `definition` ---- +test_that("derive_vars_cat Test 9: Error when condition is missing from `definition`", { # Define the condition but omit the 'condition' column from the definition definition <- exprs( ~AVALCAT1, ~AVALCA1N, @@ -152,8 +235,8 @@ test_that("derive_vars_cat Test 8: Error when condition is missing from `definit ) }) -## Test 9: Conditions for multiple VSTESTs (Height and Weight) ---- -test_that("derive_vars_cat Test 9: Conditions for multiple VSTESTs (Height and Weight)", { +## Test 10: Conditions for multiple VSTESTs (Height and Weight) ---- +test_that("derive_vars_cat Test 10: Conditions for multiple VSTESTs (Height and Weight)", { # Define conditions for two different VSTEST values: Height and BILI definition <- exprs( ~VSTEST, ~condition, ~AVALCAT1, ~AVALCA1N, @@ -163,13 +246,36 @@ test_that("derive_vars_cat Test 9: Conditions for multiple VSTESTs (Height and W "Weight", AVAL < 66.68, "Weight < 66.68", 2 ) - result <- derive_vars_cat(advs, definition, by_vars = exprs(VSTEST)) - - expect_snapshot(result) + expected_result <- tibble::tribble( + ~USUBJID, ~VSTEST, ~AVAL, ~AVALCAT1, ~AVALCA1N, + "01-701-1015", "Height", 147.32, "Height < 160", 2, + "01-701-1023", "Height", 162.56, "Height >= 160", 1, + "01-701-1028", "Height", 177.8, "Height >= 160", 1, + "01-701-1033", "Height", 175.26, "Height >= 160", 1, + "01-701-1034", "Height", NA, NA, NA, + "01-701-1047", "Height", NA, NA, NA, + "01-701-1097", "Height", 168.91, "Height >= 160", 1, + "01-701-1111", "Height", 158.24, "Height < 160", 2, + "01-701-1115", "Height", 181.61, "Height >= 160", 1, + "01-701-1118", "Height", 180.34, "Height >= 160", 1, + "01-701-1015", "Weight", 53.98, "Weight < 66.68", 2, + "01-701-1023", "Weight", 78.47, "Weight >= 66.68", 1, + "01-701-1028", "Weight", 98.88, "Weight >= 66.68", 1, + "01-701-1033", "Weight", 88.45, "Weight >= 66.68", 1, + "01-701-1034", "Weight", NA, NA, NA, + "01-701-1047", "Weight", NA, NA, NA, + "01-701-1097", "Weight", 78.02, "Weight >= 66.68", 1, + "01-701-1111", "Weight", 60.33, "Weight < 66.68", 2, + "01-701-1115", "Weight", 78.7, "Weight >= 66.68", 1, + "01-701-1118", "Weight", 71.67, "Weight >= 66.68", 1 + ) + expect_dfs_equal(base = derive_vars_cat(advs, definition, by_vars = exprs(VSTEST)), + compare = expected_result, + keys = c("USUBJID", "VSTEST")) }) -## Test 10: Adding an extra variable (flag) to the dataset ---- -test_that("derive_vars_cat Test 10: Adding an extra variable (flag) to the dataset", { +## Test 11: Adding an extra variable (flag) to the dataset ---- +test_that("derive_vars_cat Test 11: Adding an extra variable (flag) to the dataset", { # Define conditions and add a third variable (flag) that is TRUE or FALSE definition <- exprs( ~VSTEST, ~condition, ~AVALCAT1, ~AVALCA1N, ~extra_var, @@ -177,13 +283,36 @@ test_that("derive_vars_cat Test 10: Adding an extra variable (flag) to the datas "Height", AVAL < 160, "<160", 2, FALSE ) - result <- derive_vars_cat(advs, definition, by_vars = exprs(VSTEST)) - - expect_snapshot(result) + expected_result <- tibble::tribble( + ~USUBJID, ~VSTEST, ~AVAL, ~AVALCAT1, ~AVALCA1N, ~extra_var, + "01-701-1015", "Height", 147.32, "<160", 2, FALSE, + "01-701-1023", "Height", 162.56, ">=160", 1, TRUE, + "01-701-1028", "Height", 177.8, ">=160", 1, TRUE, + "01-701-1033", "Height", 175.26, ">=160", 1, TRUE, + "01-701-1034", "Height", NA, NA, NA, NA, + "01-701-1047", "Height", NA, NA, NA, NA, + "01-701-1097", "Height", 168.91, ">=160", 1, TRUE, + "01-701-1111", "Height", 158.24, "<160", 2, FALSE, + "01-701-1115", "Height", 181.61, ">=160", 1, TRUE, + "01-701-1118", "Height", 180.34, ">=160", 1, TRUE, + "01-701-1015", "Weight", 53.98, NA, NA, NA, + "01-701-1023", "Weight", 78.47, NA, NA, NA, + "01-701-1028", "Weight", 98.88, NA, NA, NA, + "01-701-1033", "Weight", 88.45, NA, NA, NA, + "01-701-1034", "Weight", NA, NA, NA, NA, + "01-701-1047", "Weight", NA, NA, NA, NA, + "01-701-1097", "Weight", 78.02, NA, NA, NA, + "01-701-1111", "Weight", 60.33, NA, NA, NA, + "01-701-1115", "Weight", 78.7, NA, NA, NA, + "01-701-1118", "Weight", 71.67, NA, NA, NA + ) + expect_dfs_equal(base = derive_vars_cat(advs, definition, by_vars = exprs(VSTEST)), + compare = expected_result, + keys = c("USUBJID", "VSTEST")) }) -## Test 11: Wrong input for by_vars ---- -test_that("derive_vars_cat Test 11: Wrong input for by_vars", { +## Test 12: Wrong input for by_vars ---- +test_that("derive_vars_cat Test 12: Wrong input for by_vars", { # Define conditions definition <- exprs( ~VSTEST, ~condition, ~AVALCAT1, ~AVALCA1N, @@ -196,8 +325,8 @@ test_that("derive_vars_cat Test 11: Wrong input for by_vars", { ) }) -## Test 12: definition has wrong shape ---- -test_that("derive_vars_cat Test 12: definition has wrong shape", { +## Test 13: definition has wrong shape ---- +test_that("derive_vars_cat Test 13: definition has wrong shape", { # Define conditions definition_wrong_shape <- exprs( ~VSTEST, ~condition, ~AVALCAT1, ~AVALCA1N,