Unable to install library functions of qdap on mac - r

I'm working on a project on R studio and I got a error message while installing qdap on my mac and running the library function.
And this is what I got.
install.packages('qdap')
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/qdap_2.3.0.tgz'
Content type 'application/x-gzip' length 4164745 bytes (4.0 MB)
==================================================
downloaded 4.0 MB
The downloaded binary packages are in
/var/folders/0v/c58lzwxd513g64xxc0gd85rm0000gn/T//RtmphbntNA/downloaded_packages
> library('qdap')
Error: package or namespace load failed for ‘qdap’:
.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.5/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib/server/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so
Reason: image not found

I found that the problem is that R is not able to locate Java_home correctly.
Steps to follow:
Download and install Java JDK if you haven't already done so.
In Terminal, find java location by typing which java
Set JAVA_HOME in R as Sys.setenv("JAVA_HOME" = 'your java location such as /usr/bin/java').
Try reinstalling the packages openNLP, rJava, and qdap.

Related

error message trying to install homals package in R

I'm trying to install the Homals package - library(homals), but keep getting this error message:
library(homals)
Error : .onLoad failed in loadNamespace() for 'rgl', details: call:
dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared
object
'/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so,
6): Library not loaded: /opt/X11/lib/libGLU.1.dylib Referenced from:
/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so
Reason: image not found Error: package or namespace load failed for
‘homals’
I have a couple of my colleagues to run the same code, the same thing happens. I have re-install R studio to the newest version.
install.packages("rgl")
install.packages("homals")
library(homals)
Any solutions for this? thank you.
I was able to successfully install on both Windows and Mac. I believe the root cause here is that you have R version 3.3 installed when you require at least v3.5.3 as per below:
library(homals)
Warning message:
package ‘homals’ was built under R version 3.5.3

rJava does not run on macOS Sierra

I am using macOS Sierra and R version 3.4.0.
I installed the package "rJava" using RStudio:
install.packages("rJava")
Warning in install.packages :
cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/PACKAGES.rds': HTTP status was '404 Not Found'
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/rJava_0.9-8.tgz'
Content type 'application/x-gzip' length 627959 bytes (613 KB)
==================================================
downloaded 613 KB
The downloaded binary packages are in
/var/folders/tq/f5jbfqp97y52w_y7byn05_fw0000gn/T//RtmpTdEVbA/downloaded_packages
Then when I try to run rJava I get:
> require(rJava)
Loading required package: rJava
Error: package or namespace load failed for ‘rJava’:
.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
R, rJava and Java are little bit messy in macOS. In general, you have to make sure to properly configure all the elements. There is a clash between Oracle's and Apple's version.
Take a look here for very detailed instructions: R, Java, rJava and macOS adventures
I don't post the content here - it's quite long.

'ChemoSpec' package in R not working on mac OS X

I'm trying to install an R package called ChemoSpec and am receiving the following error:
Error : .onLoad failed in loadNamespace() for 'rgl', details: call:
dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared
object
'/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so,
6): Library not loaded: /opt/X11/lib/libGLU.1.dylib Referenced from:
/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rgl/libs/rgl.so
Reason: image not found Error: package or namespace load failed for
‘ChemoSpec’
I'm running R version 3.3 using R Studio on OS X 10.10.5
Any help would be great! Thanks.
The problem is almost certainly that you do not have X11 installed. This in turn prevents rgl from installing, and in turn, ChemoSpec. Macs used to ship with X11 installed, but since OSX 10.6 they have not (info). You can install X11 from here. After that, try:
install.packages("rgl")
and if that is successful, do:
install.packages("ChemoSpec")
and you should be ready to go.

How to install RtidyHTML on Mac?

Any ideas how I can install RTidyHTML when I get the following error message?
install.packages("RTidyHTML", repos = "http://www.omegahat.org/R", type="source")
trying URL 'http://www.omegahat.org/R/src/contrib/RTidyHTML_0.2-1.tar.gz'
Content type 'application/x-gzip' length 554953 bytes (541 Kb)
opened URL
==================================================
downloaded 541 Kb
* installing *source* package ‘RTidyHTML’ ...
./configure: line 3: make: command not found
ERROR: configuration failed for package ‘RTidyHTML’
* removing ‘/Library/Frameworks/R.framework/Versions/2.13/Resources/library/RTidyHTML’
You need to install XCode on your Mac if you want to compile from source. (Roman's comment only applies to Windows machines.) I just tried installing it on an XCode-equipped Mac running R 2.13.0 and get first a warning during compliation
ld warning: in libtidy/libtidy.a, file is not of required architecture
installing to /Library/Frameworks/R.framework/Versions/2.13/Resources/library/RTidyHTML/libs/x86_64
... and then get an error during the test load that is part of the install script:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Library/Frameworks/R.framework/Versions/2.13/Resources/library/RTidyHTML/libs/x86_64/RTidyHTML.so':
dlopen(/Library/Frameworks/R.framework/Versions/2.13/Resources/library/RTidyHTML/libs/x86_64/RTidyHTML.so, 6): Symbol not found: _tidyBufFree
Referenced from: /Library/Frameworks/R.framework/Versions/2.13/Resources/library/RTidyHTML/libs/x86_64/RTidyHTML.so
Expected in: dynamic lookup
I suppose it is possible that it may compile under a 32 bit version of R on the Mac.64-bit. See Simon Urbanek's web page: for more specifics and some installers for other packages.
EDIT: Installation while running 32bit R from the GUI was successful with a current R (version 2.13.1 RC (2011-07-03 r56263) )

Problem with namespace installing rJava

I am installing rJava on a 64bit machine, running Windows XP, and am encountering the weirdest message. Below is the log. Has anyone seen this before? Thanks in advance.
> install.packages("rJava")
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.12/rJava_0.8-8.zip'
Content type 'application/zip' length 636680 bytes (621 Kb)
opened URL
downloaded 621 Kb
The downloaded packages are in
C:\Documents and Settings\wdeng\Local Settings\Temp\RtmpYb4lzb\downloaded_packages
> library("rJava")
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/PROGRA~1/R/R-212~1.0/library/rJava/libs/x64/rJava.dll':
LoadLibrary failure: The specified module could not be found.
Error: package/namespace load failed for 'rJava'
Looks like a garden-variety binary incompatibility to me.
The NAMESPACE is a red herring as it happens to load the dynamic library, and that's where the trouble lies.
Does the DLL file exist at that path? If it does, than maybe it's one of its dependencies that's missing. Try http://www.dependencywalker.com/ to identify which one.
After that...?

Resources