OHDSI Home | Forums | Wiki | Github

R: could not find functions after installing modules

After configuring the proxy and changing the download file method to “libcurl” (the only one that works), packages from github seem to install with no errors. In particular, after installing DatabaseConnector using devtools::install_github(‘OHDSI/DatabaseConnector’) no errors are shown in the installation log

However, methods inside that library (such as downloadJdbcDrivers or createConnectionDetails) are not found

Any ideas on why is not finding the methods?

Found the solution, was missing library(“DatabaseConnector”)

Hey Diego,

Could you elaborate? I have the same error related to dowloadJdbcDrivers() function but I don’t understand how to use the library()* to fix it

“library” allows R to know a method belongs to that package, so you don’t need to fully specify a method with its package for R.
If a package is not defined as library, something like this should be used

Sys.setenv("DATABASECONNECTOR_JAR_FOLDER"="C:/dbdrivers")
DatabaseConnector::downloadJdbcDrivers("postgresql",Sys.getenv("DATABASECONNECTOR_JAR_FOLDER"),"auto")

remember you must install the package before all this with
install.packages("DatabaseConnector")

t