I am having difficulty installing the zenplots package in R. For some odd reason when I use install.packages('zenplots') on my machine (Mac OS Catalina V-10.15.7) it installs fine... but when I try and install it on my second machine (also Mac OS Catalina V-10.15.7) and if I try and install it on my institutes server I get the following error:
Warning in fun(libname, pkgname) : couldn't connect to display ":0"
Error : package or namespace load failed for ‘loon’: .onLoad failed
in loadNamespace() for 'loon', details: call:
structure(.External(.C_dotTcl, ...), class = "tclObj") error: [tcl]
couldn't connect to display ":0".
Error: unable to load R code in package ‘zenplots’ Execution halted
I have also tried to install directly from GitHub using remotes::install_github('great-northern-diver/zenplots', force = T) but I get the same error as above.
I have even tried using install.packages("zenplots", repos="http://R-Forge.R-project.org") which works but unfortunatley this version doesn't contain all the functions found in zenplots.
My R version is above version 3.4.0, which is required for zenplots and as per the documentation I have already installed the graph package from BioConductor.
Any suggestions as to what might be the issue here?
I would guess that the R on your server was compiled without some feature required by the library. My guess: it is missing either tcltk or X11 support. To check do the following:
capabilities()
And see which features return FALSE, meaning they are not enabled.
Related
I am currently using R for Windows verison 3.5.3 and RStudio version 1.2.1335.
My goal is to import an ARFF dataset using the RWeka package in order to do some Association analysis, more specifically, to apply the Apriori algorithm.
I want to analyze a dataset (.ARFF) in R and, due to convenience, I am using the RWeka package, as my goal is to apply the Apriori algorithm, one of the associators available on that package.
That package requires some dependencies (RWekajars e rJava) and they were successfully installed.
However, when I try to run the script (I'll leave the script bellow), I always get an error related with one of the dependencies (onLoad failed in loadNamespace() for 'rJava').
Any guidance is appreciated.
Script
library(rJava)
library(RWeka)
x <- read.arff(system.file("arff", "movies_2.arff", package = "RWeka"))
Apriori(x)
Apriori(x, Weka_control(N = 20))
Errors:
library(RWeka)
Error: package or namespace load failed for ‘RWeka’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/USER/Documents/R/win-library/3.5/rJava/libs/x64/rJava.dll':
LoadLibrary failure: %1 is not a valid Win32 application.
x <- read.arff(system.file("arff", "movies_2.arff", package = "RWeka"))
Error in read.arff(system.file("arff", "movies_2.arff", package = "RWeka")) :
could not find function "read.arff"
Apriori(x)
Error in Apriori(x) : could not find function "Apriori"
Apriori(x, Weka_control(N = 20))
Error in Apriori(x, Weka_control(N = 20)) :
could not find function "Apriori"
Getting the rJava to work relies on one's computer configurations.
You may need to install JAVA for your R version. Usually when one installs JAVA it installs the 32bit version, but if you want to install JAVA 64-bit follow this link.
One will also need the JDK, if you want to install it follow this link.
I am using Windows 10 (64 bits) and I also had to make sure that the environment variable JAVA_HOME was not set (not sure why).
Sys.setenv(JAVA_HOME='')
Could be that you do not have Java installed on that machine.
Make sure you have the JRE installed.
https://www.java.com/en/download/
Update:
Following indicates Java is missing
https://www.r-statistics.com/2012/08/how-to-load-the-rjava-package-after-the-error-java_home-cannot-be-determined-from-the-registry/
Also remember to install the weka since they are in separate package RWekajars
I am trying to install the forecast package which depends on uroot, which apparently have been written to require a GPU?
install.packages("uroot") yields the following error. Has anyone found this issue and may suggest a work around? I am using ubuntu 16.04.
I have the file in question located here: /usr/local/cuda-8.0/ and I added to my path export PATH=/usr/local/cuda-8.0/:$PATH
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/rstudio2/R/x86_64-pc-linux-gnu-library/3.2/uroot/libs/uroot.so':
libcudart.so.8.0: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/rstudio2/R/x86_64-pc-linux-gnu-library/3.2/uroot’
Warning in install.packages :
installation of package ‘uroot’ had non-zero exit status
Just in case this is useful for someone, I stumbled with the same problem trying to install "imputeTS" with R version 3.5.1 on Fedora 27 with CUDA 10.0 correctly installed an setted in PATH.
for me it just happened that I was running install.package("imputeTS") (which depends on forecast) in a R console as root, installing the packages to the user home solved the problem. It's seems that the libraries are searched in different places according to the user running the script, it's important to note that.
I just migrated to Linux. On an Ubuntu 18.04 setup, using install.packages with dependencies set to TRUE succeeded with no complaints. (No GPU on mu box.)
install.packages("forecast", dep=TRUE)
# there are quite a few dependencies and you happened to be missing one
packageDescription()
#-----------includes this line----------
Imports: colorspace, fracdiff, ggplot2 (>= 2.2.1), graphics, lmtest,
magrittr, nnet, parallel, Rcpp (>= 0.11.0), stats,
timeDate, tseries, urca, uroot, zoo
You can try to modify file "/etc/rstudio/rserver.conf", add "LD_LIBRARY_PATH" env, like:
rsession-ld-library-path=/usr/local/cuda/lib64
Actually, When you open session of "RStudio Server" from browser, the session does't get env from the ".bashrc".
I am trying to install the package "rjags" in R but am running into the following error:
Loading required package: rjags
Error : .onLoad failed in loadNamespace() for 'rjags', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/rjags/libs/rjags.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/rjags/libs/rjags.so, 10): Symbol not found: __ZN5RangeC1ERKSt6vectorIiSaIiEES4_
Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/rjags/libs/rjags.so
Expected in: /usr/local/lib/libjags.3.dylib
in /Library/Frameworks/R.framework/Versions/3.1/Resources/library/rjags/libs/rjags.so
Error: package ‘rjags’ could not be loaded
I've installed JAGS on my Mac (running Mavericks), and I am running R-3.1.2. I've tried installing from the url using the devtools package, as recommended by this site:
install_url("http://sourceforge.net/projects/mcmc-jags/files/rjags/3/rjags_3-2.tar.gz",
args="--configure-args='--with-jags-include=/Users/casallas/homebrew/opt/jags/include/JAGS
--with-jags-lib=/Users/casallas/homebrew/opt/jags/lib'
"
)
I've also gone through the instructions on this other site , trying the different versions of JAGS and receive the same error. I'm at a loss for what to try next and am sure the solution is simple. Does anyone have any insights? Thanks so much!
I found that while I was unable to install rjags from the url, if I installed the package from source on my computer I was successful. I did this by downloading the appropriate package from here (which for me was rjags_3-14.tgz) and ran the following command:
install.packages(path_to_file, repos = NULL, type="source")
The error:
Symbol not found: __ZN5RangeC1ERKSt6vectorIiSaIiEES4_
Is (nearly) always caused by a mismatch between standard libraries between the Mavericks build of R (actually rjags) and Snow Leopard build of JAGS (or vice versa). For more info see the instructions at https://sourceforge.net/projects/mcmc-jags/files/JAGS/3.x/Mac%20OS%20X/
I'm guessing that compiling the package yourself from source worked because it matched the version of the standard library that JAGS is using, but this will no longer match the version that R is using (although I'm not sure if this is a major problem, it is not recommended). You would be better to match the builds of R and JAGS and use the pre-built rjags library from CRAN.
It is interesting that you say you have tried both builds of JAGS but I suggest trying again along these lines:
1) Use .Platform$pkgType in R to confirm if it you are using mac.binary (SL) or mac.binary.mavericks (Mavericks) - or failing that re-install the Mavericks binary of R from CRAN
2) Exit R
3) Re-install the appropriate version of JAGS
4) Re-open R and re-install the rjags library from CRAN
5) Try library(rjags)
If this doesn't work can you provide more information so I can try and track down a possible problem with the JAGS builds?
Thanks,
Matt
I'm a TA in a statistics class, and the students are supposed to use the "asbio" package in r for multiple comparisons. Some of those who have OSX are complaining that asbio will not load. I cannot reproduce the error on my own mac.
Here are the errors one of the students is seeing:
>library(asbio)
Loading required package: tcltk
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: /opt/X11/lib/libX11.6.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so
Reason: image not found
Error: package ‘tcltk’ could not be loaded
> install.packages("tcltk")
Warning in install.packages :
package ‘tcltk’ is not available (for R version 3.1.1)
Here are a few things students have tried:
install tcltk2: "It works now, but I still get errors" (Sorry, I know that's a confusing answer, but it's what I have)
install xquartz: "Now it works."
I suspect that xquartz is the right answer here, but if anybody could explain what's going on and confirm, that would be awesome.
(And why the ^& would a numerical statistics package need tcl/tk anyway???)
tcl/tk needs an X11 environment to work in for graphical output and Apple no longer ships an X11 environment with their operating system. XQuartz fills that gap, but is a separate install. Said install makes the X11 libraries available (look at the missing libraries in your errors) and those libraries—in turn—make graphical operations with tcl/tk possible.
the absio package has functions that let you do animation (like anim.ci) which rely on the graphics capabilities of tcl/tk.
A student in the class posted the following instructions:
1) Install xquartz. You don't need to click it ever again after installing it.
2) Restart computer.
3) Open Rstudio (or whatever R). Run library(tcltk). Don't use require or install.packages for it. Computer should now open up xquartz on its own.
4) Run install.packages("asbio")
5) library(asbio)
6) You should be able to run pairw.anova.
(I'm still waiting to see if the student wants credit by name here, but in any case, I'm thankful to them.)
I'm trying to install the R package ggplot2, though the error that I am getting seems unrelated to that specific package. I am running on Mac OSX 10.6.8. The error message is at the bottom of this message. What happened was:
I opened up R and typed install.packages("ggplot2"). After typing this, an X11 window opened saying that I should update to the latest version of X11. I clicked through and updated X11. The install went through fine, ending with a big green check mark.
Then, I thought, "let me check if R is up to date as well, as the ggplot documentation suggests updating R before installing ggplot". So I opened up R, and clicked "check for updates". Lo and behold! an update appeared. I downloaded and installed the update. The install went through fine, ending with a big green check mark.
When I opened R, I typed install.packages("ggplot2") and I got the message below:
> install.packages("ggplot2");
--- Please select a CRAN mirror for use in this session ---
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.0/Resources/library/tcltk/libs/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.0/Resources/library/tcltk/libs/tcltk.so, 10):
Library not loaded: /usr/X11/lib/libfreetype.6.dylib
Referenced from: /usr/local/lib/libtk8.6.dylib
Reason: Incompatible library version: libtk8.6.dylib requires version 14.0.0 or later, but libfreetype.6.dylib provides version 13.0.0
Your help is greatly appreciated. Thanks.
Try installing the latest version of XQuartz. It worked for me.