ggplot2 package failing to load - r

I just recently updated my Rstudio to the 0.98.1103 release and now I'm unable to load ggplot it keeps throwing the following error. Any ideas what is going on?
> library(ggplot2)
Error : .onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /usr/X11/lib/libXft.2.dylib
Referenced from: /usr/local/lib/libtk8.6.dylib
Reason: image not found
Error: package or namespace load failed for ‘ggplot2
I tried removing the tcltk library and ggplot2 and reinstalling them now I'm getting a different set of errors:
> library(ggplot2)
Error : package ‘tcltk’ does not have a namespace
Error: package or namespace load failed for ‘ggplot2’
> library(tcltk)
Error in library(tcltk) : ‘tcltk’ is not a valid installed package

Seems like X11 is not installed on your system. Try installing xorg (if you're running Linux) or XQuartz if you're on OSX.

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’ could not be loaded after installing R version 3.4

Loading required package: xml2
Loading required package: rJava
Loading required package: methods
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/r Java.so
Reason: image not found
Error: package ‘rJava’ could not be loaded
Execution halted
I'm getting this error a day after I installed version 3.4 of R. I tried solutions from other pages but it didn't work. I can't run R scripts through the terminal but I run scripts on RStudio. I'm thinking that it might be a problem with paths, but I just wanted to double check here and confirm instead of getting myself into a deeper mess.

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.

Installing Bioconductor highthroughputassays workflow gives rgl errors and fail to load

When I try to install the bioconductor workflow 'highthroughputassays' as follows (and as described here):
> source("http://bioconductor.org/workflows.R")
> workflowInstall("highthroughputassays")
It installs a lot of dependent packages, but just before ending the installation it gives the following errors:
No man pages found in package ‘highthroughputassays’
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error : .onLoad failed in loadNamespace() for 'rgl', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Users/johansenkh/Library/R/3.3/library/rgl/libs/rgl.so':
dlopen(/Users/johansenkh/Library/R/3.3/library/rgl/libs/rgl.so, 6): Library not loaded: /opt/X11/lib/libGLU.1.dylib
Referenced from: /Users/johansenkh/Library/R/3.3/library/rgl/libs/rgl.so
Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Users/johansenkh/Library/R/3.3/library/highthroughputassays’
Warning in install.packages :
installation of package ‘highthroughputassays’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/hb/sc3x6vtj0ys009qnyplbp2_h1g5hgm/T/RtmpDkWkRH/downloaded_packages’
Because of those errors, the workflow does not load;
library(flowStats)
gives a similar error after installing packages as described above.
I have tried it on 3 different Mac computers (all with the newest OS X, but one of them had the 3.3.1 version of R (The newest version is 3.3.2))
When trying library(rgl) I get the following error:
Error : .onLoad failed in loadNamespace() for 'rgl', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Users/johansenkh/Library/R/3.3/library/rgl/libs/rgl.so':
dlopen(/Users/johansenkh/Library/R/3.3/library/rgl/libs/rgl.so, 6): Library not loaded: /opt/X11/lib/libGLU.1.dylib
Referenced from: /Users/johansenkh/Library/R/3.3/library/rgl/libs/rgl.so
Reason: image not found
Error: package or namespace load failed for ‘rgl’
I solved the problem as follows:
The problem was with loading 'rgl'.
By installing XQUARTZ (www.XQUARTZ.com) followed by restarting OS X (Log out and log in) the rgl-package worked. Thereafter the workflow installed as indicated above.

Error in installing "rgl" package in Yosemite 10.10.4

I get this message whenever I try to install rgl package on Yosemite 10.10.4
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.2/Resources/library/rgl/libs/rgl.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so, 6): Library not loaded: /opt/X11/lib/libGLU.1.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/rgl.so
Reason: image not found
Error: package or namespace load failed for ‘rgl’
How can I fix this?
Six years too late but for other people searching for a solution. The solution that worked for me is to download and install XQuartz https://www.xquartz.org
See Stackoverflow answers here and here

Resources