OHDSI Home | Forums | Wiki | Github

R version error for CohortGenerator and DbDiagnostics seen with R-4.2.2 and R-4.3.1

I’m trying to run DbDiagnostics as described in the SOS Challenge video at SOS Challenge Tutorial: Data Diagnostics (Clair Blacketer, Mui Van Zandt, Sarah Seager, Apr 4) - YouTube.

According to the post at Achilles and CohortDiagonstics - Does it require a specific Java or R version? any version greater than R 3.3. should work.

I’ve tried running the following using R 4.2.2 and R 4.3.1 and get the error shown below. The full output is attached.
r-output.txt (3.2 KB)

CODE

R.Version()
remotes::install_github(“OHDSI/DbDiagnostics”)
library(DbDiagnostics)

ERROR

ERROR: dependency 'CohortGenerator' is not available for package 'DbDiagnostics'
* removing 'C:/ProgramData/R/lib/DbDiagnostics'
Warning messages:
1: package ‘CohortGenerator’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages 
2: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying C:\ProgramData\R\lib\00LOCK\curl\libs\x64\curl.dll to C:\ProgramData\R\lib\curl\libs\x64\curl.dll: Permission denied
3: In i.p(...) :
  installation of package ‘C:/Users/gresh/AppData/Local/Temp/Rtmp8GJjmn/file149206ae668ef/DbDiagnostics_1.3.1.tar.gz’ had non-zero exit status
> #
> # libraries
> #
> 
> library(DbDiagnostics)
Error in library(DbDiagnostics) : 
  there is no package called ‘DbDiagnostics’

I think this error may appear when a package is not available on CRAN. Have you tried installing CohortGenerator via install_github?

(Due to this error R rolled back the installation of DbDiagnostics as well - so once all of its dependencies are installed you can then try installing that package again)

@clairblacketer I think CohortGenerator should be added to the Remotes section of the DESCRIPTION file in DbDiagnostics, to indicate it needs to be installed from GitHub rather than CRAN.

1 Like

Thanks @katy-sadowski , that seems to have solved the problem. This seems to work:

#
# installs
#

remotes::install_github("OHDSI/CohortGenerator")
remotes::install_github("OHDSI/DbDiagnostics")

#
# libraries
#

library(DbDiagnostics)
t