Running ‘testthat.R’ [252s/298s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > library(testthat) # nolint: undesirable_function_linter
  > library(admiral) # nolint: undesirable_function_linter
  > 
  > test_check("admiral")
  [ FAIL 47 | WARN 342 | SKIP 3 | PASS 681 ]
  
  ══ Skipped tests (3) ═══════════════════════════════════════════════════════════
  • On CRAN (3): 'test-derive_var_ontrtfl.R:419:3', 'test-duplicates.R:43:3',
    'test-roxygen2.R:20:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-admiral_options.R:15:3'): get_admiral_option Test 3: non-character argument triggers assertion error ──
  <assert_character_scalar/assert-admiraldev/rlang_error/error/condition>
  Error in `get_admiral_option(subject_keys)`: Argument `option` must be a scalar of class <character>, but is a number.
  Backtrace:
       ▆
    1. ├─testthat::expect_error(get_admiral_option(subject_keys), "`option` must be a character scalar but is `1`") at test-admiral_options.R:15:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::get_admiral_option(subject_keys)
    8.   └─admiraldev::assert_character_scalar(option)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-admiral_options.R:27:3'): set_admiral_options Test 5: unexpected function input for set gives error ──
  <assert_vars/assert-admiraldev/rlang_error/error/condition>
  Error in `set_admiral_options(subject_keys = rlang::quos(STUDYID, USUBJID2))`: Each element of the list in argument `subject_keys` must be class/type <symbol>.
  i But, element 1 is a <quosure> object, and element 2 is a <quosure> object
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-admiral_options.R:27:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::set_admiral_options(subject_keys = rlang::quos(STUDYID, USUBJID2))
    8.   └─admiraldev::assert_vars(subject_keys)
    9.     └─admiraldev::assert_list_of(...)
   10.       └─cli::cli_abort(...)
   11.         └─rlang::abort(...)
  ── Error ('test-call_derivation.R:35:3'): call_derivation Test 1:  Test that call_derivation generates expected summary ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─admiral::call_derivation(...) at test-call_derivation.R:35:3
   2. │ └─admiraldev::assert_list_of(variable_params, "params")
   3. └─admiral::params(...)
  ── Error ('test-call_derivation.R:92:3'): call_derivation Test 2: Test that call_derivation generates expected imputation ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─admiral::call_derivation(...) at test-call_derivation.R:92:3
   2. │ └─admiraldev::assert_list_of(variable_params, "params")
   3. └─admiral::params(dtc = AESTDTC, date_imputation = "first", new_vars_prefix = "AST")
  ── Error ('test-call_derivation.R:112:3'): call_derivation Test 3: Test that Error is thrown if ... has no arguments ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test-call_derivation.R:112:3
   2. │ └─testthat:::expect_condition_matching(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. ├─admiral::call_derivation(...)
   8. │ └─admiraldev::assert_list_of(variable_params, "params")
   9. └─admiral::params(dtc = AESTDTC, date_imputation = "first", new_vars_prefix = "AST")
  ── Error ('test-call_derivation.R:170:3'): call_derivation Test 6: Error is thrown if passed params are not properly named ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test-call_derivation.R:170:3
   2. │ └─testthat:::expect_condition_matching(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. ├─admiral::call_derivation(...)
   8. │ └─admiraldev::assert_list_of(variable_params, "params")
   9. └─admiral::params(XYZ)
  ── Error ('test-call_derivation.R:208:3'): call_derivation Test 8: Error is thrown if duplicate parameters ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test-call_derivation.R:208:3
   2. │ └─testthat:::expect_condition_matching(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─admiral::params(dtc = VSDTC, dtc = VSDTC, new_vars_prefix = "A")
  ── Error ('test-consolidate_metadata.R:24:3'): consolidate_metadata Test 1: consolidation works ──
  Error in `assert_list_of(datasets, class = "data.frame", named = TRUE)`: argument "cls" is missing, with no default
  Backtrace:
      ▆
   1. ├─admiraldev::expect_dfs_equal(...) at test-consolidate_metadata.R:24:3
   2. │ └─diffdf::diffdf(...)
   3. └─admiral::consolidate_metadata(...)
   4.   └─admiraldev::assert_list_of(datasets, class = "data.frame", named = TRUE)
   5.     └─admiraldev::assert_character_scalar(cls)
  ── Error ('test-consolidate_metadata.R:51:3'): consolidate_metadata Test 2: error if key vars are not unique ──
  Error in `assert_list_of(datasets, class = "data.frame", named = TRUE)`: argument "cls" is missing, with no default
  Backtrace:
      ▆
   1. ├─testthat::expect_error(...) at test-consolidate_metadata.R:51:3
   2. │ └─testthat:::expect_condition_matching(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─admiral::consolidate_metadata(...)
   8.   └─admiraldev::assert_list_of(datasets, class = "data.frame", named = TRUE)
   9.     └─admiraldev::assert_character_scalar(cls)
  ── Failure ('test-consolidate_metadata.R:77:3'): consolidate_metadata Test 3: check_keys deprecation test ──
  `try(...)` did not throw the expected warning.
  ── Error ('test-consolidate_metadata.R:105:3'): consolidate_metadata Test 4: warn if variables differ ──
  Error in `assert_list_of(datasets, class = "data.frame", named = TRUE)`: argument "cls" is missing, with no default
  Backtrace:
      ▆
   1. ├─testthat::expect_warning(...) at test-consolidate_metadata.R:105:3
   2. │ └─testthat:::expect_condition_matching(...)
   3. │   └─testthat:::quasi_capture(...)
   4. │     ├─testthat (local) .capture(...)
   5. │     │ └─base::withCallingHandlers(...)
   6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   7. └─admiral::consolidate_metadata(...)
   8.   └─admiraldev::assert_list_of(datasets, class = "data.frame", named = TRUE)
   9.     └─admiraldev::assert_character_scalar(cls)
  ── Error ('test-derive_advs_params.R:222:3'): compute_bsa Test 25: an error is issued if an invalid method is specified ──
  <assert_character_scalar/assert-admiraldev/rlang_error/error/condition>
  Error in `compute_bsa(height = c(170, 185), weight = c(75, 90), method = "unknown-method")`: Argument `method` must be equal to one of "Mosteller", "DuBois-DuBois", "Haycock", "Gehan-George", "Boyd", "Fujimoto", or "Takahira".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:222:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::compute_bsa(height = c(170, 185), weight = c(75, 90), method = "unknown-method")
    8.   └─admiraldev::assert_character_scalar(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_advs_params.R:294:3'): derive_param_bmi Test 32: BMI parameter NOT added - wrong hgt unit ──
  <assert_unit/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_bmi(input, by_vars = exprs(USUBJID, VISIT), get_unit_expr = VSSTRESU)`: It is expected that "HEIGHT" has unit of "cm". In the input dataset the unit is "m".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:294:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_bmi(input, by_vars = exprs(USUBJID, VISIT), get_unit_expr = VSSTRESU)
    8.   └─admiraldev::assert_unit(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_advs_params.R:312:3'): derive_param_bmi Test 33: BMI parameter NOT added - wrong wgt unit ──
  <assert_unit/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_bmi(input, by_vars = exprs(USUBJID, VISIT), get_unit_expr = VSSTRESU)`: It is expected that "WEIGHT" has unit of "kg". In the input dataset the unit is "g".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:312:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_bmi(input, by_vars = exprs(USUBJID, VISIT), get_unit_expr = VSSTRESU)
    8.   └─admiraldev::assert_unit(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_advs_params.R:331:3'): derive_param_bmi Test 34: BMI parameter NOT added - multiple unit for wgt ──
  <assert_unit/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_bmi(input, by_vars = exprs(USUBJID, VISIT), get_unit_expr = VSSTRESU)`: Multiple units "kg" and "g" found for "WEIGHT". Please review and update the units.
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:331:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_bmi(input, by_vars = exprs(USUBJID, VISIT), get_unit_expr = VSSTRESU)
    8.   └─admiraldev::assert_unit(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_advs_params.R:348:3'): derive_param_bmi Test 35: BMI parameter NOT added - PARAMCD not set ──
  <assert_varval_list/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_bmi(input, by_vars = exprs(USUBJID, VISIT), set_values_to = exprs(PARAM = "Body Mass Index"), 
      get_unit_expr = VSSTRESU)`: The following required elements are missing from argument `set_values_to`: "PARAMCD".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:348:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_bmi(...)
    8.   └─admiraldev::assert_varval_list(set_values_to, required_elements = "PARAMCD")
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_advs_params.R:479:3'): derive_param_bsa Test 39: BSA parameter NOT added - wrong unit for height ──
  <assert_unit/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_bsa(input, by_vars = exprs(USUBJID, VISIT), method = "Mosteller", 
      get_unit_expr = VSSTRESU)`: It is expected that "HEIGHT" has unit of "cm". In the input dataset the unit is "m".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:479:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_bsa(...)
    8.   └─admiraldev::assert_unit(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_advs_params.R:502:3'): derive_param_bsa Test 40: BSA parameter NOT added - wrong unit for weight ──
  <assert_unit/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_bsa(input, by_vars = exprs(USUBJID, VISIT), method = "Mosteller", 
      get_unit_expr = VSSTRESU)`: It is expected that "WEIGHT" has unit of "kg". In the input dataset the unit is "g".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:502:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_bsa(...)
    8.   └─admiraldev::assert_unit(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_advs_params.R:526:3'): derive_param_bsa Test 41: BSA parameter NOT added - multiple unit for weight ──
  <assert_unit/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_bsa(input, by_vars = exprs(USUBJID, VISIT), method = "Mosteller", 
      get_unit_expr = VSSTRESU)`: Multiple units "kg" and "g" found for "WEIGHT". Please review and update the units.
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:526:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_bsa(...)
    8.   └─admiraldev::assert_unit(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_advs_params.R:548:3'): derive_param_bsa Test 42: BSA parameter NOT added - PARAMCD not set ──
  <assert_varval_list/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_bsa(input, by_vars = exprs(USUBJID, VISIT), method = "Mosteller", 
      set_values_to = exprs(PARAM = "Body Surface Area"), get_unit_expr = VSSTRESU)`: The following required elements are missing from argument `set_values_to`: "PARAMCD".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:548:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_bsa(...)
    8.   └─admiraldev::assert_varval_list(set_values_to, required_elements = "PARAMCD")
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_advs_params.R:906:3'): derive_param_map Test 52: MAP parameter NOT added - wrong DIABP unit ──
  <assert_unit/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_map(input, by_vars = exprs(USUBJID, VISIT), get_unit_expr = extract_unit(PARAM))`: It is expected that "DIABP" has unit of "mmHg". In the input dataset the unit is "mHg".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:906:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_map(input, by_vars = exprs(USUBJID, VISIT), get_unit_expr = extract_unit(PARAM))
    8.   └─admiraldev::assert_unit(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_advs_params.R:927:3'): derive_param_map Test 53: MAP parameter NOT added - wrong SYSBP unit ──
  <assert_unit/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_map(input, by_vars = exprs(USUBJID, VISIT), get_unit_expr = extract_unit(PARAM))`: It is expected that "SYSBP" has unit of "mmHg". In the input dataset the unit is "mHg".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:927:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_map(input, by_vars = exprs(USUBJID, VISIT), get_unit_expr = extract_unit(PARAM))
    8.   └─admiraldev::assert_unit(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_advs_params.R:949:3'): derive_param_map Test 54: MAP parameter NOT added - wrong PULSE unit ──
  <assert_unit/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_map(input, by_vars = exprs(USUBJID, VISIT), hr_code = "PULSE", 
      get_unit_expr = extract_unit(PARAM))`: It is expected that "PULSE" has unit of "beats/min". In the input dataset the unit is "beats/m".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:949:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_map(...)
    8.   └─admiraldev::assert_unit(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_advs_params.R:971:3'): derive_param_map Test 55: MAP parameter NOT added - PARAMCD not set ──
  <assert_varval_list/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_map(input, by_vars = exprs(USUBJID, VISIT), set_values_to = exprs(PARAM = "Mean Arterial Pressure"), 
      get_unit_expr = extract_unit(PARAM))`: The following required elements are missing from argument `set_values_to`: "PARAMCD".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_advs_params.R:971:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_map(...)
    8.   └─admiraldev::assert_varval_list(set_values_to, required_elements = "PARAMCD")
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_param_exist_flag.R:70:3'): derive_param_merged_exist_flag Test 2: error is issued if paramter already exists in dataset ──
  <assert_param_does_not_exist/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_exist_flag(dataset = adrs, dataset_ref = adsl, dataset_add = adrs, 
      filter_add = PARAMCD == "OVR", condition = AVALC == "PD", 
      false_value = "N", set_values_to = exprs(PARAMCD = "OVR", 
          ANL01FL = "Y"))`: The parameter code "OVR" already exists in dataset `dataset`.
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_param_exist_flag.R:70:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_exist_flag(...)
    8.   └─admiraldev::assert_param_does_not_exist(dataset, set_values_to$PARAMCD)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_param_exposure.R:165:3'): derive_param_exposure Test 3: Errors ──
  <assert_varval_list/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_exposure(., dataset_add = input, by_vars = exprs(USUBJID), 
      input_code = "DOSE", analysis_var = AVAL, summary_fun = function(x) mean(x, 
          na.rm = TRUE), set_values_to = exprs(PARCAT1 = "OVERALL"))`: The following required elements are missing from argument `set_values_to`: "PARAMCD".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_param_exposure.R:165:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─input %>% ...
    8. └─admiral::derive_param_exposure(...)
    9.   └─admiraldev::assert_varval_list(set_values_to, required_elements = "PARAMCD")
   10.     └─cli::cli_abort(...)
   11.       └─rlang::abort(...)
  ── Error ('test-derive_param_extreme_record.R:133:3'): derive_param_extreme_record Test 3: Error given when sources is not in proper list format ──
  <assert_list_of/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_extreme_record(dataset = aevent, sources = records_source(dataset_name = "pr", 
      filter = PRDECOD == "ACS", new_vars = exprs(ADT = convert_dtc_to_dt(PRSTDTC), 
          AVALC = PRDECOD)), source_datasets = list(pr = pr), by_vars = exprs(STUDYID, 
      USUBJID), order = exprs(ADT), mode = "first", set_values_to = exprs(PARAMCD = "FIRSTACT", 
      PARAM = "First Anti-Cancer Therapy"))`: Each element of the list in argument `sources` must be class/type <records_source>.
  i But, element 1 is a string, element 2 is a call, and element 3 is a list
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_param_extreme_record.R:133:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_extreme_record(...)
    8.   └─admiraldev::assert_list_of(sources, "records_source")
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_param_tte.R:316:3'): derive_param_tte Test 4: error is issued if DTC variables specified for date ──
  <assert_date_var/assert-admiraldev/rlang_error/error/condition>
  Error in `filter_date_sources(sources = event_conditions, source_datasets = source_datasets, 
      by_vars = by_vars, create_datetime = create_datetime, subject_keys = subject_keys, 
      mode = "first")`: Column "AESTDTC" in dataset `ae` must be a date or datetime, but is a character vector.
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_param_tte.R:316:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─admiral::derive_param_tte(...)
    8. │ ├─... %>% mutate(!!tmp_event := 1L)
    9. │ └─admiral:::filter_date_sources(...)
   10. │   └─admiraldev::assert_date_var(...)
   11. │     └─cli::cli_abort(...)
   12. │       └─rlang::abort(...)
   13. └─dplyr::mutate(., `:=`(!!tmp_event, 1L))
  ── Error ('test-derive_param_tte.R:575:3'): derive_param_tte Test 8: errors if PARAMCD and by_vars are not one to one ──
  <assert_one_to_one/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_tte(dataset_adsl = adsl, by_vars = exprs(AEDECOD), 
      start_date = TRTSDT, event_conditions = list(ttae), censor_conditions = list(eos), 
      source_datasets = list(adsl = adsl, ae = ae), set_values_to = exprs(PARAMCD = "TTAE", 
          PARCAT2 = AEDECOD))`: For some values of "PARAMCD" there is more than one value of "AEDECOD"
  i Call `admiral::get_one_to_many_dataset()` to get all one-to-many values.
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_param_tte.R:575:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_tte(...)
    8.   └─admiraldev::assert_one_to_one(new_param, exprs(PARAMCD), by_vars)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_param_tte.R:638:3'): derive_param_tte Test 9: errors if set_values_to contains invalid expressions ──
  Error in `process_set_values_to(., set_values_to)`: Assigning variables failed!
  * `set_values_to = exprs(PARAMCD = paste0("TTAE", as.numeric(as.factor(AEDECOD))), PARAM = past("Time to First", AEDECOD, "Adverse Event"), PARCAT1 = TTAE, PARCAT2 = AEDECOD)`
  See error message below:
  i In argument: `PARAM = past("Time to First", AEDECOD, "Adverse Event")`. Caused by error in `past()`: ! could not find function "past"
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_param_tte.R:638:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─admiral::derive_param_tte(...)
    8. │ └─... %>% remove_tmp_vars()
    9. ├─admiraldev::remove_tmp_vars(.)
   10. ├─dplyr::mutate(...)
   11. └─admiraldev::process_set_values_to(., set_values_to)
   12.   └─base::tryCatch(...)
   13.     └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   14.       └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   15.         └─value[[3L]](cond)
   16.           └─cli::cli_abort(...)
   17.             └─rlang::abort(...)
  ── Error ('test-derive_param_tte.R:721:3'): derive_param_tte Test 10: error is issued if parameter code already exists ──
  <assert_param_does_not_exist/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_param_tte(expected_output, dataset_adsl = adsl, start_date = TRTSDT, 
      event_conditions = list(ttae), censor_conditions = list(eos), 
      source_datasets = list(adsl = adsl, ae = ae), set_values_to = exprs(PARAMCD = "TTAE", 
          PARAM = "Time to First Adverse Event"))`: The parameter code "TTAE" already exists in dataset `dataset`.
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_param_tte.R:721:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_param_tte(...)
    8.   └─admiraldev::assert_param_does_not_exist(dataset, unique_params[i])
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_summary_records.R:85:3'): derive_summary_records Test 3: Errors ──
  <assert_vars/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_summary_records(input, by_vars = "x", set_values_to = exprs(z = mean(z)))`: Argument `by_vars` must be class <list>, but is a string.
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_summary_records.R:85:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_summary_records(input, by_vars = "x", set_values_to = exprs(z = mean(z)))
    8.   └─admiraldev::assert_vars(by_vars)
    9.     └─admiraldev::assert_list_of(...)
   10.       └─admiraldev::assert_s3_class(...)
   11.         └─cli::cli_abort(...)
   12.           └─rlang::abort(...)
  ── Error ('test-derive_var_extreme_date.R:202:3'): derive_var_extreme_dtm Test 5: error is issued if `--DTC` variable is specified ──
  <assert_date_var/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_var_extreme_dtm(adsl, new_var = LSTALVDTM, source_datasets = list(ae = ae), 
      ae_start, mode = "last")`: Column "AESTDTC" in dataset `ae` must be a date or datetime, but is a character vector.
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_var_extreme_date.R:202:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_var_extreme_dtm(...)
    8.   └─admiraldev::assert_date_var(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_var_merged_ef_msrc.R:27:3'): derive_var_merged_ef_msrc Test 1: wihtout by_vars ──
  Error in `assert_list_of(source_datasets, class = "data.frame", named = TRUE)`: argument "cls" is missing, with no default
  Backtrace:
      ▆
   1. └─admiral::derive_var_merged_ef_msrc(...) at test-derive_var_merged_ef_msrc.R:27:3
   2.   └─admiraldev::assert_list_of(...)
   3.     └─admiraldev::assert_character_scalar(cls)
  ── Error ('test-derive_var_merged_ef_msrc.R:74:3'): derive_var_merged_ef_msrc Test 2: with by_vars ──
  Error in `assert_list_of(source_datasets, class = "data.frame", named = TRUE)`: argument "cls" is missing, with no default
  Backtrace:
      ▆
   1. └─admiral::derive_var_merged_ef_msrc(...) at test-derive_var_merged_ef_msrc.R:74:3
   2.   └─admiraldev::assert_list_of(...)
   3.     └─admiraldev::assert_character_scalar(cls)
  ── Error ('test-derive_vars_aage.R:19:3'): derive_vars_aage Test 2: Error is thrown when age_unit is not proper unit ──
  <assert_character_scalar/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_vars_aage(input, age_unit = "centuries")`: Argument `age_unit` must be equal to one of "year", "years", "yr", "yrs", "y", "month", "months", "mo", "mos", "week", "weeks", "wk", "wks", "w", "day", "days", "d", "hour", ..., "secs", or "s".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_vars_aage.R:19:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_vars_aage(input, age_unit = "centuries")
    8.   └─admiraldev::assert_character_scalar(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-derive_vars_aage.R:62:3'): derive_var_age_years Test 5: Error is thrown when age_unit is not proper unit ──
  <assert_character_scalar/assert-admiraldev/rlang_error/error/condition>
  Error in `derive_var_age_years(input, AGE, age_unit = "month", new_var = AAGE)`: Argument `age_unit` must be equal to one of "years", "months", "weeks", "days", "hours", "minutes", or "seconds".
  Backtrace:
       ▆
    1. ├─testthat::expect_error(...) at test-derive_vars_aage.R:62:3
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─admiral::derive_var_age_years(input, AGE, age_unit = "month", new_var = AAGE)
    8.   └─admiraldev::assert_character_scalar(...)
    9.     └─cli::cli_abort(...)
   10.       └─rlang::abort(...)
  ── Error ('test-restrict_derivation.R:15:3'): restrict_derivation Test 1: restrict derivation with parameters ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─admiral::restrict_derivation(...) at test-restrict_derivation.R:15:3
   2. │ └─admiraldev::assert_s3_class(args, "params", optional = TRUE)
   3. └─admiral::params(by_vars = exprs(USUBJID))
  ── Error ('test-restrict_derivation.R:74:5'): restrict_derivation Test 3: access functions from the parent environment ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
       ▆
    1. ├─testthat::expect_silent(...) at test-restrict_derivation.R:73:3
    2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ ├─withr::with_output_sink(...)
    5. │   │ │ └─base::force(code)
    6. │   │ ├─base::withCallingHandlers(...)
    7. │   │ └─base::withVisible(code)
    8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    9. ├─admiral::restrict_derivation(...) at test-restrict_derivation.R:74:5
   10. │ └─admiraldev::assert_s3_class(args, "params", optional = TRUE)
   11. └─admiral::params(new_var = X)
  ── Error ('test-restrict_derivation.R:98:3'): restrict_derivation Test 4: allow dplyr functions ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─admiral::restrict_derivation(...) at test-restrict_derivation.R:98:3
   2. │ └─admiraldev::assert_s3_class(args, "params", optional = TRUE)
   3. └─admiral::params(AVAL = AVAL + 1)
  ── Error ('test-slice_derivation.R:10:3'): slice_derivation Test 1: slice derivation ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─admiral::slice_derivation(...) at test-slice_derivation.R:10:3
   2. │ └─admiraldev::assert_s3_class(args, "params", optional = TRUE)
   3. └─admiral::params(dtc = VSDTC, new_vars_prefix = "A")
  ── Error ('test-slice_derivation.R:48:3'): slice_derivation Test 2: non matching observations ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─admiral::slice_derivation(...) at test-slice_derivation.R:48:3
   2. │ └─admiraldev::assert_s3_class(args, "params", optional = TRUE)
   3. └─admiral::params(dtc = VSDTC, new_vars_prefix = "A")
  ── Error ('test-slice_derivation.R:82:3'): slice_derivation Test 3: empty slice ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─admiral::slice_derivation(...) at test-slice_derivation.R:82:3
   2. │ └─admiraldev::assert_s3_class(args, "params", optional = TRUE)
   3. └─admiral::params(dtc = VSDTC, new_vars_prefix = "A")
  ── Error ('test-slice_derivation.R:120:3'): slice_derivation Test 4: slice without arguments ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─admiral::slice_derivation(...) at test-slice_derivation.R:120:3
   2. │ └─admiraldev::assert_s3_class(args, "params", optional = TRUE)
   3. └─admiral::params(dtc = VSDTC, new_vars_prefix = "A", time_imputation = "last")
  ── Error ('test-user_utils.R:150:3'): print.source Test 13: `source` objects are printed as intended ──
  Error in `is_named(list[[name]])`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─testthat::expect_identical(capture.output(print(ttae)), expected_print_output) at test-user_utils.R:150:3
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. ├─utils::capture.output(print(ttae))
   5. │ └─base::withVisible(...elt(i))
   6. ├─base::print(ttae)
   7. └─admiral:::print.source(ttae)
   8.   └─admiral::print_named_list(x, indent = indent)
  ── Error ('test-user_utils.R:155:3'): print.source Test 14: `source` objects containing `source` objects ──
  Error in `is_named(args)`: could not find function "is_named"
  Backtrace:
      ▆
   1. ├─admiral::derivation_slice(filter = AVISITN > 0, args = params(new_var = CHG)) at test-user_utils.R:155:3
   2. │ └─admiraldev::assert_s3_class(args, "params", optional = TRUE)
   3. └─admiral::params(new_var = CHG)
  ── Error ('test-user_utils.R:229:3'): print_named_list Test 18: named list with unamed list ──
  Error in `is_named(list[[name]])`: could not find function "is_named"
  Backtrace:
      ▆
   1. └─testthat::expect_snapshot(...) at test-user_utils.R:229:3
   2.   └─rlang::cnd_signal(state$error)
  
  [ FAIL 47 | WARN 342 | SKIP 3 | PASS 681 ]
  Error: Test failures
  Execution halted