Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$ operator is invalid for atomic vectors #1118

Open
ablack3 opened this issue Jun 10, 2024 · 2 comments
Open

$ operator is invalid for atomic vectors #1118

ablack3 opened this issue Jun 10, 2024 · 2 comments

Comments

@ablack3
Copy link
Collaborator

ablack3 commented Jun 10, 2024

I'm running cohort diagnostics (current OHDSI main branch) and getting the following error.

Thread: Main
Message: $ operator is invalid for atomic vectors
Level: FATAL
Time: 2024-06-06 12:36:18

Stack trace:
4: RunDiagnostics.R#807: executeCohortRelationshipDiagnostics(connection = connection, databaseId = databaseId, exportFolder = exportFolder, cohortDatabaseSchema = cohortDatabaseSchema, cdmDatabase
3: Private.R#326: eval(expr)
2: RunDiagnostics.R#801: timeExecution(exportFolder, "executeCohortRelationshipDiagnostics", cohortIds, parent = "executeDiagnostics", expr = {
executeCohortRelationshipDiagnostics(connection =
1: CohortDiagnostics::executeDiagnostics(cohortDefinitionSet = cohortDefinitionSet, connectionDetails = connectionDetails, cdmDatabaseSchema = cdmSchema, cohortDatabaseSchema = writeSchema, databas

R version:
R version 4.4.0 (2024-04-24)

Platform:
x86_64-pc-linux-gnu

Attached base packages:

  • stats
  • graphics
  • grDevices
  • datasets
  • utils
  • methods
  • base

image

Some cohorts have zero counts in my database.

@ablack3
Copy link
Collaborator Author

ablack3 commented Jun 11, 2024

temporalCovariateSettings = temporalCovariateSettings[[1]],

temporalCovariateSettings is a covariateSettings object but when executeCohortRelationshipDiagnostics is called only the first element of the list is passed in. So inside executeCohortRelationshipDiagnostics the temporalCovariateSettings is a length one logical vector.

Then inside executeCohortRelationshipDiagnostics it seems as if temporalCovariateSettings is expected to be a
covariate settings object.

temporalStartDays <- temporalCovariateSettings$temporalStartDays

So I think

temporalCovariateSettings = temporalCovariateSettings[[1]],

should not include the subsetting.

temporalCovariateSettings = temporalCovariateSettings,
Has anyone else experienced this issue?

@azimov
Copy link
Collaborator

azimov commented Jun 25, 2024

I think this issue is caused by a check occuring only when running temporal characterization is false:

temporalCovariateSettings <- list(temporalCovariateSettings)

I should be able to resolve this in the develop branch today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants