OHDSI / SelfControlledCaseSeries

An R package for performing Self-Controlled Case Series (SCCS) analyses in an observational database in the OMOP Common Data Model.
http://ohdsi.github.io/SelfControlledCaseSeries
13 stars 8 forks source link

Problems loading up packages #12

Closed oxonnsn closed 4 years ago

oxonnsn commented 6 years ago

Hi there, I'm new to R and the SCCS package - but have been having problems loading up the SCCS package. I'm running MacOS High Sierra and I've installed Java - checked on Terminal -
adminsmac$ java -version java version "9.0.1" Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

- but when loading the SCCS package: "install.packages("devtools") library(devtools) install_github("ohdsi/OhdsiRTools") install_github("ohdsi/SqlRender") install_github("ohdsi/DatabaseConnector") install_github("ohdsi/Cyclops") install_github("ohdsi/SelfControlledCaseSeries")"

- I am getting the error messages: Error : .onLoad failed in loadNamespace() for 'rJava', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so': dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: @rpath/libjvm.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so Reason: image not found ERROR: lazy loading failed for package ‘SqlRender’

Do you have any advice? Many thanks!

Total script:

install.packages("devtools") trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/devtools_1.13.4.tgz' Content type 'application/x-gzip' length 439078 bytes (428 KB)

downloaded 428 KB

The downloaded binary packages are in /var/folders/w9/03_q4w_s2wg9sl82dl2j7yy40000gp/T//RtmpeTtEZr/downloaded_packages

library(devtools) install_github("ohdsi/OhdsiRTools") Skipping install of 'OhdsiRTools' from a github remote, the SHA1 (38585047) has not changed since last install. Use force = TRUE to force installation Warning message: In strptime(x, fmt, tz = "GMT") : unknown timezone 'zone/tz/2017c.1.0/zoneinfo/Europe/London' install_github("ohdsi/SqlRender") Downloading GitHub repo ohdsi/SqlRender@master from URL https://api.github.com/repos/ohdsi/SqlRender/zipball/master Installing SqlRender '/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \ '/private/var/folders/w9/03_q4w_s2wg9sl82dl2j7yy40000gp/T/RtmpeTtEZr/devtools11ce44132b91d/OHDSI-SqlRender-558bbe0' \ --library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library' --install-tests

ERROR: dependency ‘DatabaseConnector’ is not available for package ‘SelfControlledCaseSeries’

schuemie commented 6 years ago

@PRijnbeek sent me this solution some time ago:

sudo ln -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
sudo R CMD javareconf
install.packages("rJava",type='source')

Peter, maybe you can elaborate?