Running ‘testthat.R’ [38s/83s]
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/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(PhenotypeR)
  > 
  > test_check("PhenotypeR")
  ===============>---------------   50% | ETA:  5s
  ========================>------   79% | ETA:  5s
  * Getting codelists from cohorts
  * Getting index event breakdown
  Getting counts of b codes for cohort cohort_1
  * Getting diagnostics for measurement concepts
  Saving _problems/test-codelistDiagnostics-90.R
  [ FAIL 1 | WARN 4 | SKIP 21 | PASS 0 ]
  
  ══ Skipped tests (21) ══════════════════════════════════════════════════════════
  • On CRAN (17): 'test-addCodelistAttribute.R:2:3',
    'test-addCodelistAttribute.R:70:3', 'test-addCodelistAttribute.R:118:3',
    'test-codelistDiagnostics.R:2:3', 'test-codelistDiagnostics.R:48:3',
    'test-cohortDiagnostics.R:2:3', 'test-cohortDiagnostics.R:51:3',
    'test-databaseDiagnostics.R:2:3', 'test-dbms.R:3:3', 'test-dbms.R:25:3',
    'test-getCohortExpectations.R:3:3', 'test-getCohortExpectations.R:26:3',
    'test-getCohortExpectations.R:61:3', 'test-phenotypeDiagnostics.R:3:3',
    'test-populationDiagnostics.R:2:3', 'test-shinyDiagnostics.R:3:3',
    'test-shinyDiagnostics.R:53:3'
  • empty test (4): 'test-cohortDiagnostics.R:144:1',
    'test-cohortDiagnostics.R:148:1', 'test-cohortDiagnostics.R:152:1',
    'test-cohortDiagnostics.R:158:1'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-codelistDiagnostics.R:90:3'): measurementDiagnostics working ───
  Error in `summariseMeasurementUseInternal(cdm = cdm, codes = codes, cohort = cohort, timing = timing, timingName = timing, byConcept = byConcept, byYear = byYear, bySex = bySex, ageGroup = ageGroup, dateRange = dateRange, estimates = estimates, histogram = histogram, checks = checks)`: x `checks` a choice between: measurement_summary, measurement_value_as_number, and measurement_value_as_concept.
  ! `checks` must be a choice between: measurement_summary, measurement_value_as_number, and measurement_value_as_concept; it can not contain NA; it can not be NULL.
  Backtrace:
      ▆
   1. └─PhenotypeR::codelistDiagnostics(cdm$my_cohort) at test-codelistDiagnostics.R:90:3
   2.   └─MeasurementDiagnostics::summariseCohortMeasurementUse(...)
   3.     └─MeasurementDiagnostics:::summariseMeasurementUseInternal(...)
   4.       └─omopgenerics::assertChoice(checks, choices = allowedChecks)
   5.         └─omopgenerics:::errorMessage(...)
   6.           └─cli::cli_abort(message = message, call = call)
   7.             └─rlang::abort(...)
  
  [ FAIL 1 | WARN 4 | SKIP 21 | PASS 0 ]
  Error:
  ! Test failures.
  Execution halted