* using log directory 'd:/Rcompile/CRANpkg/local/4.4/metatools.Rcheck' * using R version 4.4.3 (2025-02-28 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 13.3.0 GNU Fortran (GCC) 13.3.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'metatools/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'metatools' version '0.1.6' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'metatools' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... [1s] OK * checking whether the package can be loaded with stated dependencies ... [1s] OK * checking whether the package can be unloaded cleanly ... [1s] OK * checking whether the namespace can be loaded with stated dependencies ... [1s] OK * checking whether the namespace can be unloaded cleanly ... [2s] OK * checking loading without being on the library search path ... [2s] OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [6s] OK * checking Rd files ... [1s] OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking examples ... [6s] ERROR Running examples in 'metatools-Ex.R' failed The error most likely occurred in: > ### Name: check_ct_data > ### Title: Check Control Terminology for a Dataset > ### Aliases: check_ct_data > > ### ** Examples > > library(haven) > library(metacore) > library(magrittr) > load(metacore_example("pilot_ADaM.rda")) > spec <- metacore %>% select_dataset("ADSL") Warning: `core` from the `ds_vars` table only contains missing values. Warning: `supp_flag` from the `ds_vars` table only contains missing values. Warning: `common` from the `var_spec` table only contains missing values. Warning: `where` from the `value_spec` table only contains missing values. Warning: `dataset` from the `supp` table only contains missing values. Warning: `variable` from the `supp` table only contains missing values. Warning: `idvar` from the `supp` table only contains missing values. Warning: `qeval` from the `supp` table only contains missing values. ✔ ADSL dataset successfully selected > data <- read_xpt(metatools_example("adsl.xpt")) > > check_ct_data(data, spec) Error: The following variables contained values not found in the control terminology Variable (Prohibited Value(s)) DCSREAS ('ADVERSE EVENT', 'STUDY TERMINATED BY SPONSOR', 'DEATH', 'WITHDRAWAL BY SUBJECT', 'PHYSICIAN DECISION', 'PROTOCOL VIOLATION', 'LOST TO FOLLOW-UP', 'LACK OF EFFICACY') Execution halted * checking for unstated dependencies in 'tests' ... OK * checking tests ... [26s] ERROR Running 'spelling.R' [0s] Running 'testthat.R' [26s] Running the tests in 'tests/testthat.R' failed. Complete output: > library(testthat) > library(metatools) > > test_check("metatools") ✔ ADSL dataset successfully selected v ADAE dataset successfully selected Not all datasets provided. Only variables from ADSL will be gathered. Not all datasets provided. Only variables from ADSL will be gathered. v ADSL dataset successfully selected ✔ ADSL dataset successfully selected ✔ Metadata successfully imported ℹ To use the Metacore object with metatools package, first subset a dataset using `metacore::select_dataset()` DISCONFL has no control terminology v Metadata successfully imported i Dataset metadata imported with suppressed warnings i To use the Metacore object with metatools package, first subset a dataset using `metacore::select_dataset()` Keys uniquely identify records ✔ Metadata successfully imported ℹ Dataset metadata imported with suppressed warnings ℹ To use the Metacore object with metatools package, first subset a dataset using `metacore::select_dataset()` ✔ ADSL dataset successfully selected ✔ ADSL dataset successfully selected v AE dataset successfully selected v DM dataset successfully selected v DM dataset successfully selected v Metadata successfully imported i Dataset metadata imported with suppressed warnings i To use the Metacore object with metatools package, first subset a dataset using `metacore::select_dataset()` v AE dataset successfully selected v ADSL dataset successfully selected [ FAIL 10 | WARN 107 | SKIP 0 | PASS 78 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-build.R:11:3'): drop_unspec_vars ─────────────────────────────── Error in `select(., all_of(man_vars))`: i In argument: `all_of(man_vars)`. Caused by error in `all_of()`: ! Can't subset elements that don't exist. x Elements `AGEGR2` and `AGEGR2N` don't exist. ── Failure ('test-build.R:132:4'): add_variables ─────────────────────────────── add_variables(data, spec) (`actual`) not equal to `data` (`expected`). `actual` is length 51 `expected` is length 49 `names(actual)[47:51]`: "EOSSTT" "DCSREAS" "MMSETOT" "AGEGR2" "AGEGR2N" `names(expected)[47:49]`: "EOSSTT" "DCSREAS" "MMSETOT" `actual$AGEGR2` is a character vector (NA, NA, NA, NA, NA, ...) `expected$AGEGR2` is absent `actual$AGEGR2N` is an integer vector (NA, NA, NA, NA, NA, ...) `expected$AGEGR2N` is absent ── Error ('test-checks.R:14:4'): get_bad_ct works correctly ──────────────────── Error: We currently don't have the ability to check against external libraries Backtrace: ▆ 1. ├─testthat::expect_equal(get_bad_ct(data, spec, "DISCONFL"), character(0)) at test-checks.R:14:4 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─metatools::get_bad_ct(data, spec, "DISCONFL") ── Error ('test-checks.R:52:4'): check_ct_col works correctly ────────────────── Error in `check_ct_col(data, spec, DCSREAS, TRUE)`: The following values should not be present: 'ADVERSE EVENT', 'STUDY TERMINATED BY SPONSOR', 'DEATH', 'WITHDRAWAL BY SUBJECT', 'PHYSICIAN DECISION', 'PROTOCOL VIOLATION', 'LOST TO FOLLOW-UP', 'LACK OF EFFICACY' Backtrace: ▆ 1. ├─testthat::expect_equal(...) at test-checks.R:52:4 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─metatools::check_ct_col(data, spec, DCSREAS, TRUE) ── Error ('test-checks.R:77:4'): check_ct_data works correctly ───────────────── Error: The following variables contained values not found in the control terminology Variable (Prohibited Value(s)) DCSREAS ('ADVERSE EVENT', 'STUDY TERMINATED BY SPONSOR', 'DEATH', 'WITHDRAWAL BY SUBJECT', 'PHYSICIAN DECISION', 'PROTOCOL VIOLATION', 'LOST TO FOLLOW-UP', 'LACK OF EFFICACY') Backtrace: ▆ 1. ├─testthat::expect_equal(check_ct_data(data, spec), data) at test-checks.R:77:4 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─metatools::check_ct_data(data, spec) ── Error ('test-checks.R:96:4'): variable_check works correctly ──────────────── Error in `check_variables(data, spec)`: The following variables are missing: AGEGR2 AGEGR2N Backtrace: ▆ 1. ├─testthat::expect_equal(check_variables(data, spec), data) at test-checks.R:96:4 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. └─metatools::check_variables(data, spec) ── Error ('test-checks.R:113:4'): check_unique_keys works as expected ────────── Error in `cl$metacore_filter(dataset)`: ADLBHY is not a dataset in the metacore objectFALSE Backtrace: ▆ 1. └─metatools::build_from_derived(...) at test-checks.R:113:4 2. └─metatools:::make_lone_dataset(metacore, dataset_name) 3. └─metacore::select_dataset(metacore, dataset_name) 4. └─cl$metacore_filter(dataset) ── Failure ('test-supp.R:71:4'): make_supp_qual ──────────────────────────────── `metacore_supp` (`actual`) not equal to `man_supp` (`expected`). actual vs expected QORIG - actual[1, ] derived + expected[1, ] DERIVED - actual[2, ] derived + expected[2, ] DERIVED - actual[3, ] derived + expected[3, ] DERIVED - actual[4, ] derived + expected[4, ] DERIVED - actual[5, ] derived + expected[5, ] DERIVED - actual[6, ] derived + expected[6, ] DERIVED - actual[7, ] derived + expected[7, ] DERIVED - actual[8, ] derived + expected[8, ] DERIVED - actual[9, ] derived + expected[9, ] DERIVED - actual[10, ] derived + expected[10, ] DERIVED and 1181 more ... actual$QORIG | expected$QORIG [1] "derived" - "DERIVED" [1] [2] "derived" - "DERIVED" [2] [3] "derived" - "DERIVED" [3] [4] "derived" - "DERIVED" [4] [5] "derived" - "DERIVED" [5] [6] "derived" - "DERIVED" [6] [7] "derived" - "DERIVED" [7] [8] "derived" - "DERIVED" [8] [9] "derived" - "DERIVED" [9] [10] "derived" - "DERIVED" [10] ... ... ... and 1181 more ... ── Failure ('test-supp.R:84:4'): make_supp_qual ──────────────────────────────── `dm_supp` (`actual`) not equal to `man_dm_supp` (`expected`). actual vs expected QORIG - actual[1, ] derived + expected[1, ] DERIVED - actual[2, ] derived + expected[2, ] DERIVED - actual[3, ] derived + expected[3, ] DERIVED - actual[4, ] derived + expected[4, ] DERIVED - actual[5, ] derived + expected[5, ] DERIVED - actual[6, ] derived + expected[6, ] DERIVED - actual[7, ] derived + expected[7, ] DERIVED - actual[8, ] derived + expected[8, ] DERIVED - actual[9, ] derived + expected[9, ] DERIVED - actual[10, ] derived + expected[10, ] DERIVED and 1187 more ... actual$QORIG | expected$QORIG [1] "derived" - "DERIVED" [1] [2] "derived" - "DERIVED" [2] [3] "derived" - "DERIVED" [3] [4] "derived" - "DERIVED" [4] [5] "derived" - "DERIVED" [5] [6] "derived" - "DERIVED" [6] [7] "derived" - "DERIVED" [7] [8] "derived" - "DERIVED" [8] [9] "derived" - "DERIVED" [9] [10] "derived" - "DERIVED" [10] ... ... ... and 1187 more ... ── Failure ('test-supp.R:96:4'): make_supp_qual ──────────────────────────────── `.` (`actual`) not equal to `man_dm_supp` (`expected`). actual vs expected QORIG - actual[1, ] derived + expected[1, ] DERIVED - actual[2, ] derived + expected[2, ] DERIVED - actual[3, ] derived + expected[3, ] DERIVED - actual[4, ] derived + expected[4, ] DERIVED - actual[5, ] derived + expected[5, ] DERIVED - actual[6, ] derived + expected[6, ] DERIVED - actual[7, ] derived + expected[7, ] DERIVED - actual[8, ] derived + expected[8, ] DERIVED - actual[9, ] derived + expected[9, ] DERIVED - actual[10, ] derived + expected[10, ] DERIVED and 1187 more ... actual$QORIG | expected$QORIG [1] "derived" - "DERIVED" [1] [2] "derived" - "DERIVED" [2] [3] "derived" - "DERIVED" [3] [4] "derived" - "DERIVED" [4] [5] "derived" - "DERIVED" [5] [6] "derived" - "DERIVED" [6] [7] "derived" - "DERIVED" [7] [8] "derived" - "DERIVED" [8] [9] "derived" - "DERIVED" [9] [10] "derived" - "DERIVED" [10] ... ... ... and 1187 more ... Backtrace: ▆ 1. ├─... %>% expect_equal(man_dm_supp) at test-supp.R:96:4 2. └─testthat::expect_equal(., man_dm_supp) [ FAIL 10 | WARN 107 | SKIP 0 | PASS 78 ] Error: Test failures Execution halted * checking PDF version of manual ... [17s] OK * checking HTML version of manual ... [4s] OK * DONE Status: 2 ERRORs