EHDEN / CdmInspection

R Package to support quality control inspection of an OMOP-CDM instance
Apache License 2.0
11 stars 16 forks source link

Error when generating result document #52

Closed sdebruyn closed 3 years ago

sdebruyn commented 3 years ago

R command:

CdmInspection::generateResultsDocument(results,
                                       outputFolder,
                                       authors="LynxCare",
                                       databaseDescription = databaseDescription,
                                       databaseName = databaseName,
                                       databaseId = databaseId)

Error in output:

could not find function "%>%"
Error in doc %>% officer::body_add_img(logo, width = 6.1, height = 1.59, :

Output folder contains 2 files:

Content of log_cdmInspection.txt:

2021-02-10 09:20:33 [Main thread]   INFO    CdmInspection   cdmInspection   CDM Inspection of database REDACTED started (cdm_version=5.3.1)
2021-02-10 09:20:33 [Main thread]   INFO    CdmInspection   cdmInspection   Running Data Table Checks
2021-02-10 09:20:36 [Main thread]   INFO    CdmInspection   executeQuery    >  Data tables count query executed successfully in 2.56 secs
2021-02-10 09:20:36 [Main thread]   INFO    CdmInspection   executeQuery    >  Total number of records over time query executed successfully in 0.40 secs
2021-02-10 09:20:37 [Main thread]   INFO    CdmInspection   executeQuery    >  Number of records per person query executed successfully in 0.46 secs
2021-02-10 09:20:37 [Main thread]   INFO    CdmInspection   executeQuery    >  Number of records per person query executed successfully in 0.14 secs
2021-02-10 09:20:37 [Main thread]   INFO    CdmInspection   .getCdmSource   > Vocabulary table successfully extracted
2021-02-10 09:20:37 [Main thread]   INFO    CdmInspection   cdmInspection   Running Vocabulary Checks
2021-02-10 09:20:58 [Main thread]   INFO    CdmInspection   executeQuery    >  Mapping Completeness query executed successfully in 20.72 secs
2021-02-10 09:20:59 [Main thread]   INFO    CdmInspection   executeQuery    >  Drug Level Mapping query executed successfully in 1.57 secs
2021-02-10 09:21:00 [Main thread]   INFO    CdmInspection   executeQuery    >  Unmapped drugs query executed successfully in 0.53 secs
2021-02-10 09:21:01 [Main thread]   INFO    CdmInspection   executeQuery    >  Unmapped conditions query executed successfully in 0.50 secs
2021-02-10 09:21:01 [Main thread]   INFO    CdmInspection   executeQuery    >  Unmapped measurements query executed successfully in 0.83 secs
2021-02-10 09:21:02 [Main thread]   INFO    CdmInspection   executeQuery    >  Unmapped observations query executed successfully in 0.54 secs
2021-02-10 09:21:03 [Main thread]   INFO    CdmInspection   executeQuery    >  Unmapped procedures query executed successfully in 0.60 secs
2021-02-10 09:21:03 [Main thread]   INFO    CdmInspection   executeQuery    >  Unmapped devices query executed successfully in 0.16 secs
2021-02-10 09:21:03 [Main thread]   INFO    CdmInspection   executeQuery    >  Mapped drugs query executed successfully in 0.66 secs
2021-02-10 09:21:05 [Main thread]   INFO    CdmInspection   executeQuery    >  Mapped conditions query executed successfully in 1.40 secs
2021-02-10 09:21:06 [Main thread]   INFO    CdmInspection   executeQuery    >  Mapped measurements query executed successfully in 1.37 secs
2021-02-10 09:21:07 [Main thread]   INFO    CdmInspection   executeQuery    >  Mapped observations query executed successfully in 1.32 secs
2021-02-10 09:21:09 [Main thread]   INFO    CdmInspection   executeQuery    >  Mapped procedures query executed successfully in 1.57 secs
2021-02-10 09:21:09 [Main thread]   INFO    CdmInspection   executeQuery    >  Mapped devices query executed successfully in 0.34 secs
2021-02-10 09:21:10 [Main thread]   INFO    CdmInspection   executeQuery    >  Concept counts by vocabulary query executed successfully in 0.78 secs
2021-02-10 09:21:23 [Main thread]   INFO    CdmInspection   executeQuery    >  Count on vocabulary tables query executed successfully in 12.54 secs
2021-02-10 09:21:23 [Main thread]   INFO    CdmInspection   executeQuery    >  Source to concept map breakdown query executed successfully in 0.38 secs
2021-02-10 09:21:35 [Main thread]   INFO    CdmInspection   executeQuery    >  Source to concept map query executed successfully in 12.19 secs
2021-02-10 09:21:35 [Main thread]   INFO    CdmInspection   cdmInspection   Check installed R Packages
2021-02-10 09:21:35 [Main thread]   INFO    CdmInspection   cdmInspection   > All HADES packages are installed
2021-02-10 09:21:37 [Main thread]   INFO    CdmInspection   cdmInspection   Running Performance Checks on Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz cpu with 4 cores, and 16.82 GB ram.
2021-02-10 09:21:37 [Main thread]   INFO    CdmInspection   cdmInspection   Running Performance Checks SQL
2021-02-10 09:21:37 [Main thread]   INFO    CdmInspection   executeQuery    >  Retrieving duration of Achilles queries in 0.20 secs
2021-02-10 09:21:44 [Main thread]   INFO    CdmInspection   executeQuery    >  Executing vocabulary query benchmark in 6.70 secs
2021-02-10 09:21:44 [Main thread]   INFO    CdmInspection   cdmInspection   Done.
2021-02-10 09:21:44 [Main thread]   INFO    CdmInspection   cdmInspection   Complete CdmInspection took  1.20  minutes
2021-02-10 09:21:47 [Main thread]   INFO    CdmInspection   cdmInspection   The cdm inspection results have been exported to: /tmp/omop/cdm_inspection
PRijnbeek commented 3 years ago

You need to have dplyr package. it should actually load that automatically since it is in Description. Could try to do library(dplyr) and install it if you do no have it.

sdebruyn commented 3 years ago

Version 1.0.4 of dplyr is installed

PRijnbeek commented 3 years ago

great when you called library(dplyr) and then did the call you had the same issue?

PRijnbeek commented 3 years ago

https://stackoverflow.com/questions/30248583/error-could-not-find-function

sdebruyn commented 3 years ago
 library(dplyr)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union
PRijnbeek commented 3 years ago

yes that is fine and if you then run the generateResultsDocument what happens?

sdebruyn commented 3 years ago

After adding that, the error changed to this:

Error in table_layout() : could not find function "table_layout"
Calls: <Anonymous> ... <Anonymous> -> <Anonymous> -> my_body_add_table -> <Anonymous>
PRijnbeek commented 3 years ago

that is coming from the officer package. It looks like all the depends are not working for you: https://github.com/EHDEN/CdmInspection/blob/5b4afe70a607a41fe9fd765c360a9a8ba939e1f0/DESCRIPTION#L23

Normally these should be loaded automatically not sure why that does not happen in your case: https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Package-Dependencies

It might be I have to move these to imports instead of depends. Will try this in upcoming version update you should have tomorrow morning.

sdebruyn commented 3 years ago

Version 1.0.3 is working without issues