2
votes

I've installed qdap:

install.packages("qdap")

It takes a while to donwload everything but the console fills up with all the downloads and at the end I get a message like this:

Warning in install.packages :
  installation of package ‘qdap’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpeTzuKz/downloaded_packages’
> library(qdap)
Error in library(qdap) : there is no package called ‘qdap’
> 

This SO post led me to try adding dependencies = TRUE but the issue remains.

Here's session info

sessionInfo():
> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS

Matrix products: default
BLAS: /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.18.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.4.0 tools_3.4.0   

Another post I found yesterday (cannot find it again now with a Google search) suggested I remove existing qdap files within my library directory, close my session, restart and fresh install. There was no package exactly called qdap but some with qdap in the name which I removed. My issue remained, I am unable to install qdap.

I'm not sure what other information to provide? Any help appreciated.

Here are the errors generated when attempting to install qdap:

./configure: line 3736: /usr/lib/jvm/default-java/jre/bin/java: No such file or directory no configure: error: Java interpreter '/usr/lib/jvm/default-java/jre/bin/java' does not work ERROR: configuration failed for package ‘rJava’ * removing ‘/home/myname/R/x86_64-pc-linux-gnu-library/3.4/rJava’ Warning in install.packages : installation of package ‘rJava’ had non-zero exit status ERROR: dependency ‘rJava’ is not available for package ‘openNLPdata’ * removing ‘/home/myname/R/x86_64-pc-linux-gnu-library/3.4/openNLPdata’ Warning in install.packages : installation of package ‘openNLPdata’ had non-zero exit status ERROR: dependency ‘rJava’ is not available for package ‘xlsxjars’ * removing ‘/home/myname/R/x86_64-pc-linux-gnu-library/3.4/xlsxjars’ Warning in install.packages : installation of package ‘xlsxjars’ had non-zero exit status ERROR: dependency ‘rJava’ is not available for package ‘venneuler’ * removing ‘/home/myname/R/x86_64-pc-linux-gnu-library/3.4/venneuler’ Warning in install.packages : installation of package ‘venneuler’ had non-zero exit status ERROR: dependencies ‘openNLPdata’, ‘rJava’ are not available for package ‘openNLP’ * removing ‘/home/myname/R/x86_64-pc-linux-gnu-library/3.4/openNLP’ Warning in install.packages : installation of package ‘openNLP’ had non-zero exit status ERROR: dependencies ‘rJava’, ‘xlsxjars’ are not available for package ‘xlsx’ * removing ‘/home/myname/R/x86_64-pc-linux-gnu-library/3.4/xlsx’ Warning in install.packages : installation of package ‘xlsx’ had non-zero exit status ERROR: dependencies ‘openNLP’, ‘venneuler’, ‘xlsx’ are not available for package ‘qdap’ * removing ‘/home/myname/R/x86_64-pc-linux-gnu-library/3.4/qdap’ Warning in install.packages : installation of package ‘qdap’ had non-zero exit status

Since this looks like a rJava issue I found this post and tried the top voted answer in the terminal:

apt-get install r-cran-rjava

Resulted in:

E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

I'm hoping theres a way around this without being a root user? I'm not as familiar with linux. I'm able to install other p packages.

1
You may want to include actual errors in the installation to identify what is going wrong.amatsuo_net
Done. Looks like a rJava issueDoug Fir
What happens if you try apt-get install r-cran-rjava? It seems that the issue for installing rjava is about the permission.amatsuo_net
@amatsuo_net that's what I tried per the top answer in the linked to post but I got the errors "E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?". I actually had our sys admin fix it for me, maybe I should delete now?Doug Fir
Sorry what I meant was using sudo. What happens with sudo apt-get install r-cran-rjava? If you know what your sys admin did to resolve, you can post it as an answer and close. That might help others.amatsuo_net

1 Answers

2
votes

There is a solution for this issue when you have no root access.

  1. Download Java (make sure to install JDK) and install it inside your $HOME

    You can do that as Oracle's Java is just a tar.gz package

  2. Make sure to set JAVA_HOME

    export JAVA_HOME=$HOME/opt/my_jdk_installation
    
  3. Once you have Java you have to reconfigure R

    Simply tell R where your Java is

    R CMD javareconf \
    JAVA_HOME=${JAVA_HOME} \
    JAVA=${JAVA_HOME}/bin/java \
    JAVAC=${JAVA_HOME}/bin/javac \
    JAVAH=${JAVA_HOME}/bin/javah \
    JAR=${JAVA_HOME}/bin/jar \
    JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/jre/lib/server \
    JAVA_CPPFLAGS="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux"
    

Since now, R should use your personal installation of Java. This way, you don't depend on sys admin.