R version 3.0.2 cannot find RCurl package - r

I'm using R version 3.0.2 on my Windows 7 (32-bit) system and am stumped trying to install rCharts. I've had no problem installing other packages from github (e.g., slidify), but R seems unable to find the dependent RCurl package I installed.
I can submit the following basic lines of code without error:
require(devtools)
library(bitops,lib.loc='c:/R/packages/')
library(RCurl,lib.loc='c:/R/packages/')
require(RCurl) # have also tried the library function without luck*
But, when I submit the command to install rCharts with
install_github('rCharts', 'ramnathv')
I get the following :
Installing github repo(s) rCharts/master from ramnathv
Downloading rCharts.zip from https://github.com/ramnathv/rCharts/archive/master.zip
Installing package from C:\Users\nakamura\AppData\Local\Temp\RtmpwzYzaG/rCharts.zip
Installing rCharts
"C:/PROGRA~1/R/R-30~1.2/bin/i386/R" --vanilla CMD INSTALL \
"C:\Users\nakamura\AppData\Local\temp\RtmpwzYzaG\rCharts-master" \
--library="C:/Program Files/R/R-3.0.2/library" --with-keep.source \
--install-tests
**ERROR: dependency 'RCurl' is not available for package 'rCharts'**
*** removing 'C:/Program Files/R/R-3.0.2/library/rCharts'
Error: Command failed (1)**
I've tried installing libcurl, but am not sure I've unzipped it to the correct folder. (From what I've been able to gather from bits and pieces of other questions about rCurl, it seems having an improper/no installation of libcurl could be a contributing factor?)
Any help would be very much appreciated. I feel like I'm going around in circles.
Ann

Adding the directory "C:/R/packages" to the front of the .libPaths variable will help R find RCurl if it's been installed to a non-standard directory.

Related

Trouble Updating plotly in R

I am having trouble plotting candlestick charts with plotly. Apparently, candlestick is not one of the types I can do with the version I have installed, which is 4.5.2. So I am trying to update plotly to the latest 4.7.1 version by doing this:
devtools::install_github("ropensci/plotly")
But this is the error I got:
> devtools::install_github("ropensci/plotly")
Downloading GitHub repo ropensci/plotly#master
from URL https://api.github.com/repos/ropensci/plotly/zipball/master
Installing plotly
"C:/PROGRA~1/MICROS~3/RCLIEN~1/R_SERVER/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD \
INSTALL "C:/Users/cinji/AppData/Local/Temp/RtmpMNgiEt/devtools27f029a57c1a/ropensci-plotly-2cc296d" \
--library="C:/Users/cinji/OneDrive/Documents/R/win-library/3.3" --install-tests
ERROR: dependencies 'rlang', 'crosstalk', 'promises' are not available for package 'plotly'
* removing 'C:/Users/cinji/OneDrive/Documents/R/win-library/3.3/plotly'
Error: Command failed (1)
What's going on? What do I need to do?
Thank you.
Update: I tried one of the answers below which was this:
install.packages(c('rlang', 'crosstalk', 'promises'))
But I got this:
> install.packages(c('rlang', 'crosstalk', 'promises'))
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing packages into ‘C:/Users/cinji/OneDrive/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
packages ‘rlang’, ‘crosstalk’, ‘promises’ are not available (for R version 3.3.2)
Does that mean I have to install another version of R? "About RStudio" tells me I have Version 1.2.1335 © 2009-2019 RStudio, Inc.
I don't enough reputation at the moment to comment, so I'll put this as an answer.
You need to install the dependencies first.
install.packages(c('rlang', 'crosstalk', 'promises'))

Installing R package from BayesTree_0.3-1.tar on Windows

I have installed R and Rtools, and set the path to both, but when I use
R CMD INSTALL C:\transfer\BayesTree_0.3-1.tar
to install this package, I get
Warning: invalid package 'c:\transfer\BayesTree_0.3-1.tar'
Error: ERROR: No packages specified
Do I need to rebuild this as a .tar.gz, or is there another problem?
Many thanks.

install RMySQL for Mac

I get below error when I try to install Mysql package (MAC OS)
install.packages('RMySQL')
package ‘RMySQL’ is available as a source package but not as a binary
Warning in install.packages :
package ‘RMySQL’ is not available (for R version 3.1.0)
I am not sure what I need to set in order for this to work.
The author of RMySQL no longer provide binary packages, so you will have to build from source.
I have posted the complete solution in another thread: Installing RMySQL in mavericks.
Basically, in order for install.packages('RMySQL', type='source') to work correctly, what you are lacking are:
Make sure you have "gcc" available.
Install MySQL client somewhere, e.g., via Homebrew.
Configure and build RMySQL from source in RStudio or in Terminal:
Set the 2 environment variables PKG_CPPFLAGS and PKG_LIBS to indicate where the include and lib are.
Run install.packages('RMySQL', type='source') in RStudio or R CMD INSTALL RMySQL_x.x-x.tar.gz in Terminal
Installing from source worked well for me. For those who are new to R, the way to install from source is:
install.packages('RMySQL', type='source')

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