Installing R on Hortonworks Sandbox hadoop 2.3 - r

I’m experiencing some troubles when I try to install R dependencies with the command :
install.packages(c(“Rcpp”,”RJSONIO”,”bitops”,”digest”,”functional”,”itertools”,”reshape2″,”string ”,”plyr”,”caTools”),repos=’http://cran.revolutionanalytics.com’)
packages are downloaded but then all I get are the messages
/usr/lib64/R/bin/R: line 8: uname: command not found
/usr/lib64/R/bin/R: line 143: exec: sh: not found
repeated as many times as the number of packages I am trying to install.
I am using R version 3.2.2, rstudio-server 0.99.489 in Hortonworks Sandbox with hadoop 2.3 (Oracle Virtualbox).
Do you have any suggestions?
Thanks for your help.

I know this question was asked 7 months ago. But I just had the same problem stefanod did and I Googled left and right without finding a solution. Then for absolutely no reasonable reason it just worked. Here is what I have tried and what eventually solves my problem:
So I use R 3.2.2, rstudio-server 0.98.994 in Hortonworks Hadoop Sandbox HDP 2.4 in VMWare. I logged in the virtual machine using the Shell Web Client Method. The entire process was done with root privilege. I followed this instruction: https://jsolderitsch.wordpress.com/hortonworks-sandbox-r-and-rstudio-install/ except that I used updated versions of R and RStudio Server. Everything worked fine until I invoked R in the shell and attempted
install.packages('foo.bar', repos='http://cran.revolutionanalytics.com')
Then I had exactly the same error messages as in this Q.
I checked my $PATH and used whereis COMMANDNAME to check if I had the uname command at the right place. Seems I do.
I then quit R. Inside CentOS I used wget to manually download the .tar.gz files of the packages and their dependencies. I then tried to install those packages manually:
[root#sandbox ~]# sudo R CMD INSTALL foo.bar.tar.gz
* installing to library ‘/usr/lib64/R/library’
* installing *source* package ‘foo.bar’ ...
** package ‘foo.bar’ successfully unpacked and MD5 sums checked
** libs
sh: make: command not found
ERROR: compilation failed for package ‘foo.bar’
* removing ‘/usr/lib64/R/library/foo.bar’
sh: rm: command not found
At this time RStudio was already installed. So I logged into RStudio in my browser at port 8787 and tried install.packages in RStudio and every package installed fine.
I guess the take-home message is to install packages inside RStudio instead of inside R in the shell.
BTW I also cannot log in RStudio as root; says invalid username and password.

Related

InstallationWarning: package 'XYZ' is in use and will not be installed: R

I am trying to install package SBCK from R build using Rscript build.R -c -v -i in windows command prompt following the steps given here. However, I ended up with package SBCK being not installed because of following error/warning InstallationWarning: package 'SBCK' is in use and will not be installed. I have no package with name SBCK installed on my system, so I do not understand why I am getting this warning message and thus not to be able to install the R package.
I know that similar question have been asked before here but solution there does not work in my case.
I am using R version 4.2.0 on Windows 10.
Once 'build.R' is run, "SBCK_0.5.0.tar.gz" is created in the 'SBCK-R' folder.
You can now install it via the package archive file option or pointing to that file in the install.packages command. I faced the same issue and this solved it.

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}

Error installing RMySQL

It took a good amount of time to install RMySQL on my Linux machine but I was able to install it after changing environment variables and copy and paste lib.dll file.
However, I'm now trying to install RMySQL on my 64bit window machine, but so far there's no progress yet for two days. It broke down after "running command sh ./configure.win had status 127 error, and I cannot find what this means.
Can anyone shed some lights on this?
install.packages('RMySQL',type='source')
Installing package into ‘C:/Users/chu/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/RMySQL_0.9-3.tar.gz'
Content type 'application/x-gzip' length 165363 bytes (161 Kb)
opened URL
downloaded 161 Kb
* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
Warning: running command 'sh ./configure.win' had status 127
ERROR: configuration failed for package 'RMySQL'
* removing 'C:/Users/chu/Documents/R/win-library/3.1/RMySQL'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\chu\Documents\R\win-library\3.1" C:\Users\chu\AppData\Local\Temp\RtmpKA9e7I/downloaded_packages/RMySQL_0.9-3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘RMySQL’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\chu\AppData\Local\Temp\RtmpKA9e7I\downloaded_packages’
for linux users..
install- libmysql first
sudo apt-get install libmysql++-dev
then try.
I was facing the same error. Given below is the link to a way around that worked for me.
http://www.ahschulz.de/2013/07/23/installing-rmysql-under-windows/
In short, the location of library libmysqll.dll required for compilation, had to be changed from lib folder to bin folder of the home directory set for MySQL in environment variables.
By default, R uses the /tmp directory to install packages. On security conscious machines, the /tmp directory is often marked as “noexec” in the /etc/fstab file. This means that no file under /tmp can ever be executed. Packages that require compilation or that have self-inflating data will fail with the error mentioned.
The solution is to set the TMPDIR environment variable outside R (in your shell), which R will use as the compilation directory. How to do this depends on the shell. bash:
mkdir ~/tmp
export TMPDIR=~/tmp
Then R can compile and install the package.
I ran into the same problem while updating packages on Windows server for latest version of R. I solved it by installing from a .zip file vs .tar.gz.
I actually had to go through the process of first downloading the package, and then installing from it (not from mirror) for other reasons.
Here is what it looked like:
pk <- 'caTools'
download.packages(pk, "R-3.2-packages/" ,type = "win.binary")
install.packages(
dir("R-3.2-packages/",pattern=pk,full.names = TRUE),
repos = NULL,
type = "source")
Hope this helps.
Solution if anyone faced the same problem on windows:
Make sure your MYSQL_HOME environment variable is set correctly and libmysql.dll is copied to bin folder!!!
Run install.packages('RMySQL') then when the "Do you want to install from sources..." window pops up select No.
Then copy the downloaded binary packages location from console.
Go to Packages -> Install, paste the location into Package archive and click Install.

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