Unable to install R package Cairo - r

I am trying to install the package Cairo on RedHat running R version 3.2.3. So far I have tried:
install.packages("Cairo")
R CMD INSTALL Cairo_1.5-9.tar.gz
Both the approaches giving me the same error below.
Error : .onLoad failed in loadNamespace() for 'Cairo', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/sandeep/R/x86_64-pc-linux-gnu-library/3.2/Cairo/libs/Cairo.so':
libpng15.so.15: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
I have tried the same logging in as root. Only the path for the shared library was different, error remained the same.
I have also tried installing packages mentioned below using
yum install cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel
Also, I have X11 libraries installed.

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

RWeka installation under Rstudio on Mac

I tried to find solutions from previous posts, but they do not solve my problem.
I am using macOS High Sierra and have Java installed. Below is the error reported by Rstudio. Also, rJava, Mac, and R are really messy with each other. I found this post but still does not work.
https://github.com/MTFA/CohortEx/wiki/Run-rJava-with-RStudio-under-OSX-10.10,-10.11-(El-Capitan)-or-10.12-(Sierra)
///////////////////
library(RWeka)
Error: package or namespace load failed for ‘RWeka’:
.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
In addition: Warning message:
package ‘RWeka’ was built under R version 3.4.4
I met the same question and I found this is helpful.
Cannot load R xlsx package on Mac OS 10.11
1.In terminal enter the following to relink Java correctly:
sudo R CMD javareconf
2.Back in R (or RStudio) install the rJava package from source:
install.packages("rJava",type='source')
Then
library(rJava)
and
library(RWeka)
should work.

Error loading rJava.so when using ReporteRsjars

I am running R 3.5.0 on a Ubuntu 18.04 machine. Some Shiny app I am testing with this new environment uses the ReporteRsjars package and gives the following error message on loading this package:
Loading required package: ReporteRsjars
Error: package or namespace load failed for ‘ReporteRsjars’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/usr/local/lib/R/site-library/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Warning: Error in : package ‘ReporteRsjars’ could not be loaded
The file /usr/local/lib/R/site-library/rJava/libs/rJava.sohowever does exist.
Any help would be appreciated!
After quite some more trying I found the solution - and realized that I mis-interpreted the error message: The missing library was actually the libjvm.so which was not found. A symlink
ln -s /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so /usr/lib
followed by a R CMD javareconfand a removal and re-installation of the rJavapackage did it for me.

Error when trying to load XLConnect Package

After updating to the latest version of Rstudio (R version 3.4.1 (2017-06-30) -- "Single Candle") I cannot seem to get the XLConnect Package to load. This is the error message I get:
> library('XLConnect')
Loading required package: XLConnectJars
Error: package or namespace load failed for ‘XLConnectJars’:.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: package ‘XLConnectJars’ could not be loaded
R also throws a similar error message when I try to load the rJava package as well. I have tried uninstalling both Java and R and have scoured SO for answers, but nothing seems to work.
I am running macOS Sierra (10.12.6)
Would anyone be willing to offer any help?
The error suggests that there is an issue loading rJava. Try updating the Java configuration variables via R CMD javareconf or sudo R CMD javareconf.

Error installing packages in R after messing with "pahts"

I was trying to install the rattle package in R and got this error message saying
configure: error: GTK version 2.8.0 required
ERROR: configuration failed for package ‘RGtk2’
Then I tried to fix the RGtk2 problem using this guide
http://marcoghislanzoni.com/blog/2014/08/29/solved-installing-rattle-r-3-1-mac-os-x-10-9/
I tried this code in the Mac OS terminal (but this is above my understanding) :
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
sudo port selfupdate
sudo port install pkgconfig
export PATH=/opt/pkgconfig/bin:$PATH
sudo port install gtk2 +x11
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
It gave me this answer
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
ad-mac0630:~ caruc35$ sudo port selfupdate
Password:
Sorry, try again.
Password:
And locked down.
I also installed XCode command line tools from Apple and tried some stuff from the guide above. It didnt get the rattle package to work so I erased it.
After messing with this the rattle package does still not work and R seems not to work as it did before. For example i can´t load the xlsx package getting this error message:
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 '/Users/caruc35/Library/R/3.4/library/rJava/libs/rJava.so':
dlopen(/Users/caruc35/Library/R/3.4/library/rJava/libs/rJava.so, 6): Library not loaded: #rpath/libjvm.dylib
Referenced from: /Users/caruc35/Library/R/3.4/library/rJava/libs/rJava.so
Reason: image not found
Error: package ‘rJava’ could not be loaded
Did I mess up when trying to change PATH? Is there a way to reset everything back to normal?
I have tried reinstalling R but the same problems still occurs.

Resources