R - devtools Github install fails - r

Trying to use Hadleys devtools package I am getting a certification error:
install_github("devtools")
Installing github repo(s) devtools/master from hadley
Installing devtools.zip from https://github.com/hadley/devtools/archive/master.zip
Error in function (type, msg, asError = TRUE) :
Peer certificate cannot be authenticated with given CA certificates
Google search tells me that this is a curl issue. I am no nearer.
Using "git" from the command line I can pick up anything I want from github, - I don't get this error. It only appears when I try to connect to github from R.
I am using ubuntu 12.10, libcurl 7.22.0 and R 3.0
Does anyone have an idea what to do to fix this?
Sincerely
H.

This issue is resolved. There was some mismatch between the version of RCurl and the curl library. Re-installing RCurl fixed the problem.

Try
$ git clone git://github.com/hadley/devtools.git
$ R CMD build devtools
$ R CMD install devtools_1.2.99.tar.gz
or just
$ git clone git://github.com/hadley/devtools.git
$ R CMD install devtools
both worked for me on Ubuntu 12.04. Someone else can weigh in on whether there's any difference in building first then installing from tarball or not. I would guess no, but I have no idea
edit:
trying this on os X
* installing to library ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library’
* installing *source* package ‘devtools’ ...
** libs
sh: make: command not found
ERROR: compilation failed for package ‘devtools’
* removing ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/devtools’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/devtools’

Related

Need help installing rJava on Mac

I am trying to download the package Xlconnect on my mac but I keep getting errors. I was able to figure out that it was because mac has some issue with Java and that I need to first resolve that before. But I've had no luck so far.
One of the things I tried was this: https://www.chrisjmendez.com/2018/11/16/installing-xlconnect-and-rjava-on-macos/
But it didn't work as well.
Can someone who has been able to successfully install rJava help me out please?
configure: error: One or more Java configuration variables are not set.
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.
If you don't have root privileges, run
R CMD javareconf -e
to set all Java-related variables and then install rJava.
ERROR: configuration failed for package ‘rJava’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava’
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/47/523c7yns0dvgc2cy147fbxrh0000gn/T/RtmpkLRoEh/downloaded_packages’
It seems as you have not set up your environment with java variables.
Try adding this to either your ~/.zshrc or ~/.basrc
export PATH={PATH_TO_JAVA_INSTALLATION}:$PATH
export JAVA_HOME={SAME_PATH_TO_JAVA_INSTALLATION}
Your Java Path is most likely in /Library/Java/JavaVirtualMachines/{some .jdk file}

installation of package ‘RCurl’ had non-zero exit status

I am trying to install RCurl on OS X 10.12.6 but get the following error:
Error: package or namespace load failed for ‘RCurl’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Users/nick/Library/R/3.4/library/RCurl/libs/RCurl.so':
dlopen(/Users/nick/Library/R/3.4/library/RCurl/libs/RCurl.so, 6): Library not loaded: #rpath/libcurl.4.dylib
Referenced from: /Users/nick/Library/R/3.4/library/RCurl/libs/RCurl.so
Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Users/nick/Library/R/3.4/library/RCurl’
The downloaded source packages are in
‘/private/var/folders/hx/9xx9fwq91t95k45dzlmzxfy40000gp/T/Rtmp14zSi1/downloaded_packages’
Warning message:
In install.packages("RCurl") :
installation of package ‘RCurl’ had non-zero exit status
This error has been discussed a bit already, but the solutions are all specific to linux and I don't think they are relevant to OS X. I did try installing the homebrew version of curl but that didn't help.
Any ideas? I think that more debugging information would be helpful, but I'm not sure what else to provide.
Thanks in advance!
Nick
If someone face the same problem in Ubuntu just as I do, the solution is run first in terminal:
sudo apt-get install libcurl4-gnutls-dev
Then in R:
install.packages('RCurl')
Looks like it's expecting libcurl.4.dylib in your #rpath.
I think others have encountered the same issue so the solution should be in here somewhere:
brew unlink R solution
Install curl again
In case it is useful for anyone else with this issue, I solved it without having to install the cran binary of R. (I use the homebrew version because it allows you to use faster BLAS options that take advantage of parallelism). Steps were:
Make sure that R doesn't find the homebrew or anaconda versions of curl-config (this will only affect the current R session)
PATH=/usr/bin/:$PATH
Download and install latest version of RCurl from http://www.omegahat.net/RCurl/ (replace <RCURLVERSION> with the current latest version)
wget http://www.omegahat.net/RCurl/RCurl_<RCURLVERSION>.tar.gz
R CMD INSTALL RCurl_<RCURLVERSION>.tar.gz

R 'mvpart' package - any option to use in R 3.1.x?

I would like to use functions in the mvpart package in R. I know it has been removed from CRAN, but I tried installing archive versions available here: http://cran.r-project.org/web/packages/mvpart/index.html
install.packages("D:/mvpart_1.6-2.tar.gz", repos = NULL, type = "source")
I get this result:
Installing package into ‘C:/Users/jk/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
* installing source package 'mvpart' ...
** package 'mvpart' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: running command 'make -f "C:/PROGRA~1/R/R-31~1.3/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.3/share/make/winshlib.mk" SHLIB="mvpart.dll" OBJECTS="anova.o branch.o bsplit.o choose_surg.o dist.o fix_cp.o formatg.o free_tree.o gini.o graycode.o insert_split.o make_cp_list.o make_cp_table.o mrt.o mysort.o nodesplit.o partition.o poisson.o pred_rpart.o rpart.o rpart_callback.o rpartexp2.o rpcountup.o rpmatrix.o rundown.o rundown2.o s_to_rp.o s_xpred.o surrogate.o usersplit.o vgdist.o xdiss.o xval.o"' had status 127
ERROR: compilation failed for package 'mvpart'
* removing 'C:/Users/jk/Documents/R/win-library/3.1/mvpart'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\jk\Documents\R\win-library\3.1" "D:/mvpart_1.6-2.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘D:/mvpart_1.6-2.tar.gz’ had non-zero exit status
My questions are: Did I do something wrong here - is there a way to install 'mvpart'? Or, is there another package that will do multivariate partitioning, similar to 'mvpart'?
Option 1:
An archive install must be compiled, as it's stored as source code. Probably, you have not installed the R Tools compiler for Windows. Follow the install instructions here.
Once that was done, for me, mvpart installed flawlessly from the downloaded archive:
install.packages("C:/mydownload/path/mvpart_1.6-2.tar.gz", repos = NULL, type = "source")
Option 2:
If Option 1 doesn't get the job done, get the devtools package:
install.packages("devtools")
Use it to get the github version:
devtools::install_github("cran/mvpart")
I believe you'll still need the R tools compiler though
downloading Xcode from either the Apple AppStore or Apple Developer website solved my issues installing mvpart. The app version required iOS 10.13 as of this post, but it was easy to find a compatible older version on the website to download. After you download it, move it to your Applications folder and then open it. After that then the devtools:::install_github() worked for me.

R: Having trouble installing rpanel

I am trying to install the packages rpanel and tkrplot on RStudio. After downloading and installing there I got this message:
downloaded 686 Kb
* installing *source* package ‘rpanel’ ...
** package ‘rpanel’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** preparing package for lazy loading
Error in structure(.External(.C_dotTcl, ...), class = "tclObj") :
[tcl] can't find package BWidget.
Error : unable to load R code in package ‘rpanel’
ERROR: lazy loading failed for package ‘rpanel’
* removing ‘..../R/i686-pc-linux-gnu-library/3.0/rpanel’
Warning in install.packages :
installation of package ‘rpanel’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp1MdC0f/downloaded_packages’
I already installed BWidget on my own, but it didn't help.
Anyone any ideas about this problem and maybe can help me?
The system is Ubuntu 12.04.
Under windows 7 there is no problem and everything is working fine.
There are easier ways to install BWidgets. On my mac with Macports I did:
sudo port install BWidget
On Ubuntu you can probably install it with apt-get:
sudo apt-get install bwidget
"Stumbled across this while looking for an answer to the same question. Like an unfortunate number of library authors, the BWidgets people have assumed that the only people who need to use their libraries are planning to code with them. For those of us who've never used TCL, the installation instructions mean nothing.
From the a document called tuto-install-tkabber on the tkabber.jabber.ru website (irritating spam catcher won't let me post a URL), the answer is:
Install the BWidgets directory into the "lib" directory returned by:
whereis tcl
It should look something like: /usr/lib/tcl8.4"
from http://www.linuxquestions.org/questions/linux-software-2/where-to-install-bwidget-tcl-98583/ did the trick for me
Also I got BWidget from: http://sourceforge.net/projects/tcllib/files/BWidget/1.7.0/BWidget-1.7.0.zip/download
#Calimo's answer worked for me on Linux Mint 18.3 RStudio R 3.6.0. I would have commented in #Calimo's thread except for the stupid 50 reputation limit.
sudo apt-get install bwidget
Also works for Ubuntu 18 R 3.4.4 but if you get an X11 issue with rgl then this helped from #Ouistiti.
I had similar issues trying to get biotools working in Rstudio (on Ubuntu 16.04), where rpanel and tkrplot are required. Even after installing Bwidget per Calimo's answer, I got the error installation of package ‘tkrplot’ had non-zero exit status because tk.h: No such file or directory. If you look in the directory, this error is definitely correct. You need to get tk.h in there. I found out how to do so elsewhere on stackexchange:
Install tcl-dev package using apt or synaptic; tcl contains the
runtime, while tcl-devel contains header and development files. Do the
same with tk-dev
from:
https://stackoverflow.com/a/9649478/10405322
Thus,
sudo apt-get install tcl-dev
sudo apt-get install tk-dev
download BWidget from
http://sourceforge.net/project/showfiles.php?group_id=12883
once you get the archive BWidget-1.7.0.tar.gz move it to /usr/local/lib and install it with following code in terminal:
sudo mv /some_download_path/BWidget-1.7.0.tar.gz /usr/local/lib
cd /usr/loca/lib
sudo tar zxf BWidget-1.7.0.tar.gz
ok, done.

R installation for RHive and/or RStudio("--enable-R-shlib")

I suspect I am having a problem with my R installation, something that has to do with "--enable-R-shlib".
Can someone explain if this is something that I can fix using apt-get?
More specifically:
I am having trouble getting installing the RHive package.
I Installed R from scratch, following the instructions in (for example):
http://cran.ru.ac.za/bin/linux/ubuntu/
basically, just doing:
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev
Next I opened R and installed rJava:
install.packages("rJava")
which worked fine.
Next I tried installing RHive:
install.packages("RHive")
at which point the installation fails with the following message:
* installing *source* package ‘Rserve’ ...
** package ‘Rserve’ successfully unpacked and MD5 sums checked
checking whether to compile the server... yes
configure: error: R was configured without --enable-R-shlib or --enable-R-static-lib
*** Rserve requires R (shared or static) library. ***
*** Please install R library or compile R with either --enable-R-shlib ***
*** or --enable-R-static-lib support ***
What Should I Do?
Also, I installed RStudio and this fails at startup with a related message:
"R shared library (/usr/local/lib64/R/lib/libR.so) not found. If this is a custom build of R, was it built with the --enable-R-shlib option"
All of which leads me to believe it is all related to the same problem. Weird thing is, I followed the same procedure on a different machine, and all seems to work fine...
I had the same problem.
In my case I changed R_HOME like this Sys.setenv(R_HOME="/usr/lib/R")
R, as well as r-cran-rjava and r-cran-rserve are available for Debian and Ubuntu as part of the basic distribution.
Can you not use those packages? They certainly work for me and many, many other people at least as far as RStudio is concerned -- I have not tried RHive myself.

Resources