OHDSI / CohortDiagnostics

An R package for performing various cohort diagnostics.
https://ohdsi.github.io/CohortDiagnostics
41 stars 48 forks source link

Current released version failing R Check + several other R check issues #1116

Closed schuemie closed 1 day ago

schuemie commented 4 months ago

The currently released version is failing R check. I see:

 Running ‘testOracle.R’ ERROR
Running the tests in ‘tests/testOracle.R’ failed.
Last 13 lines of output:

    |                                                                            
    |                                                                      |   0%
    |                                                                            
    |======================================================================| 100%
  Executing SQL took 0.134 secs
  Connecting using Oracle driver
  - using THIN to connect

    |                                                                            
    |                                                                      |   0%
    |                                                                            
    |======================================================================| 100%
  Executing SQL took 0.107 secs
  Execution halted

(Note that Github Actions also shows a segfault that I can't reproduce when running R check locally, but the error above is definitely reproducible)

Further more, there are several R check issues that I highly recommend are resolved:

Export tag

✖ Incremental.R:157: S3 method `writeToCsv.default` needs @export or @exportS3method tag.
✖ Incremental.R:190: S3 method `writeToCsv.tbl_Andromeda` needs @export or @exportS3method tag.

Please add the @export tags

dplyr decorators

combineConceptSetsFromCohorts: no visible binding for global variable
  ‘cohortId’
combineConceptSetsFromCohorts: no visible binding for global variable
  ‘sql’
...

Please use the appropriate decorators required by dplyr: for select and rename, use quotes. For all other dplyr, use .data$. For example

  checkmate::assertDataFrame(
    x = cohorts %>% dplyr::select(
      cohortId,
      sql,
      json,
      cohortName
    ),
    any.missing = FALSE,
    min.cols = 4,
    add = errorMessage
  )

should be rewritten as

  checkmate::assertDataFrame(
    x = cohorts %>% dplyr::select(
      "cohortId",
      "sql",
      "json",
      "cohortName"
    ),
    any.missing = FALSE,
    min.cols = 4,
    add = errorMessage
  )

Import statements

Consider adding
  importFrom("stats", "sd")
  importFrom("utils", "installed.packages")

Please add the requested imports here

Documentation errors

Undocumented arguments in Rd file 'timeExecution.Rd'
  ‘exportFolder’ ‘taskName’ ‘cohortIds’ ‘parent’ ‘start’ ‘execTime’
  ‘expr’

Please add the missing documentation.