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

generateResultsDocument Error in UseMethod("arrange") : no applicable method for 'arrange' applied to an object of class "NULL" #105

Open
joaofonsecapromptly opened this issue May 3, 2024 · 2 comments

Comments

@joaofonsecapromptly
Copy link

When running function generateResultsDocument, an error is reported stating

Error in UseMethod("arrange") : 
  no applicable method for 'arrange' applied to an object of class "NULL"

Using CDM Inspection version 1.2.3

This is the source code

CdmInspection::generateResultsDocument(
  results=results,
  outputFolder=file.path(getwd(), outputFolder,"catalogueExport"),
  authors = databaseName,
  databaseDescription="databaseDescription",
  databaseName = "databaseName",
  databaseId = "databaseId",
  docTemplate = "EHDEN",
  smallCellCount = NULL,
  silent = TRUE
)

I have tried changing every argumentm but the bug still stands.
Also checked results file and seems normal and when generating, no error was reported

@MaximMoinat
Copy link
Collaborator

MaximMoinat commented May 6, 2024

Could you check if one of the following result objects are empty?

  • results$vocabularyResults$mappingCompleteness$result
  • results$vocabularyResults$drugMapping$result

A quick fix when one is empty, is to replace these by (empty) dataframes:

  • results$vocabularyResults$mappingCompleteness$result <- data.frame(DOMAIN=NA, P_RECORDS_MAPPED=NA, N_CODES_SOURCE=NA, N_CODES_MAPPED=NA, P_CODES_MAPPED=NA, P_RECORDS_MAPPED=NA, N_RECORDS_SOURCE = NA, N_RECORDS_MAPPED =NA)
  • results$vocabularyResults$drugMapping$result <- data.frame(N_RECORDS=NA, CLASS=NA, N_PATIENTS = NA, N_SOURCE_CODES =NA)

But those should not be empty to begin with. Please also check the logs of cdmInspection for any errors.

@joaofonsecapromptly
Copy link
Author

Could you check if one of the following result objects are empty?

  • results$vocabularyResults$mappingCompleteness$result
  • results$vocabularyResults$drugMapping$result

A quick fix when one is empty, is to replace these by (empty) dataframes:

  • results$vocabularyResults$mappingCompleteness$result <- data.frame(DOMAIN=NA, P_RECORDS_MAPPED=NA, N_CODES_SOURCE=NA, N_CODES_MAPPED=NA, P_CODES_MAPPED=NA, P_RECORDS_MAPPED=NA, N_RECORDS_SOURCE = NA, N_RECORDS_MAPPED =NA)
  • results$vocabularyResults$drugMapping$result <- data.frame(N_RECORDS=NA, CLASS=NA, N_PATIENTS = NA, N_SOURCE_CODES =NA)

But those should not be empty to begin with. Please also check the logs of cdmInspection for any errors.

Yes, that was the case. This solution works.

I also tried updating to new version 1.2.4 and it also fixes this, not quite sure why as I did not dive into the source code. Was one these fixes implemented in 1.2.4?

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