OHDSI / CohortDiagnostics

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

'scales' package should be listed under `Imports`, not `Suggests` #1124

Open scheah92 opened 1 week ago

scheah92 commented 1 week ago

In DESCRIPTION, the package scales is listed under Suggests. However, I was running the package for the 1st time and about 2 hours in, I errored out because some code tried to call scales::comma, but I didn't have the package installed. That was an unfortunate loss of 2 hours that could have been avoided by having scales be installed as part of CohortDiagnostics installation.

Full error log:

Thread: Main
Message:  there is no package called ‘scales’
Level:  FATAL
Time:  2024-06-27 13:29:47

Stack trace:
18: (function (condition) 
{
    if (is(condition, "error")) {
        log("FATAL"
17: stop(cond)
16: doWithOneRestart(return(expr), restart)
15: withOneRestart(expr, restarts[[1]])
14: withRestarts(stop(cond), retry_loadNamespace = function() NULL)
13: loadNamespace(x)
12: paste0("   - Working with ", scales::comma(nrow(timePeriods)), " time ids."
11: lapply(list(...), as.character)
10: .makeMessage(...)
9: log(level = "TRACE", ...)
8: ParallelLogger::logTrace(paste0("   - Working with ", scales::comma(nrow(ti
7: runCohortRelationshipDiagnostics(connection = connection, cohortDatabaseSch
6: eval(expr)
5: timeExecution(exportFolder, "runCohortRelationshipDiagnostics", c(subset[st
4: executeCohortRelationshipDiagnostics(connection = connection, databaseId = 
3: eval(expr)
2: timeExecution(exportFolder, "executeCohortRelationshipDiagnostics", cohortI
1: CohortDiagnostics::executeDiagnostics(cohortDefinitionSet, connectionDetail

R version:
R version 4.3.3 (2024-02-29)

Platform:
x86_64-pc-linux-gnu

Attached base packages:
- stats
- graphics
- grDevices
- utils
- datasets
- methods
- base

Other attached packages: