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'))
Related
I'm trying to prepare a report to my colleagues and students. I think the best way to make it reproducible is through Google Colab. My analysis was performed using R and some packages available on CRAN.
I am using a Jupyter Notebook with R kernel. I used the followinf link to create a Notebook with netive R kernel: https://colab.research.google.com/notebook#create=true&language=r. As you can see as follows, its running R.
a <- 1
print(a)
However, when I try to install the exactextractr package I get the following error:
install.packages("exactextractr")
Output:
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘proxy’, ‘e1071’, ‘wk’, ‘sp’, ‘terra’, ‘classInt’, ‘s2’, ‘units’, ‘Rcpp’, ‘raster’, ‘sf’
Warning message in install.packages("exactextractr"):
“installation of package ‘units’ had non-zero exit status”
Warning message in install.packages("exactextractr"):
“installation of package ‘sf’ had non-zero exit status”
Warning message in install.packages("exactextractr"):
“installation of package ‘exactextractr’ had non-zero exit status”
The package was not installed:
library(exactextractr)
Output:
Error in library(exactextractr): there is no package called ‘exactextractr’
Traceback:
1. library(exactextractr)
What is the problem here?
Because the Linux variant underlying the GoogleColab is Ubuntu, you could also take advantage of r2u which brings about 20,000 binary CRAN packages with full dependencies to Ubuntu. So if (here) libudunits is needed, it gets installed!
A have a quick demo gif in this tweet (as SO limits image sizes) -- 17s total for everything from a 'blank' start in a container with just R, and r2u set up. This works in any Ubuntu system on stanard x86_64 (ie Intel or AMD): laptop, desktop, server, cloud, continuous integration, ... Give it a try -- as the demo shows it installs correctly via a single install.packages("exactextractor") from R!
Some of the packages that you are trying to install (exactextractr, terra, sf, units) have system dependencies. You can see that on the CRAN pages for these packages (here for terra) under "SystemRequirements".
In this case, you need to have GDAL, GEOS, PROJ, and udunits-2. Depending on the underlying linux system you can do something like the below to install them.
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libudunits2-dev libgdal-dev libgeos-dev libproj-dev
This is essentially what r2evans suggests in the comments. And there is no doubt in my mind that what he says is correct.
See the github pages for more guidance on installing these packages. Here for "terra".
Also, try to install the dependencies one by one, so that it becomes clearer where the problem is.
E.g.
install.packages(‘proxy’)
install.packages(‘e1071’)
install.packages(‘wk’)
install.packages(‘sp’)
install.packages(‘terra’)
Etcetera.
Do this in one cell - R Colab doesn't support sudo directly.
system('sudo apt install libudunits2-dev')
Then this should work (I tried it successfully)
install.packages("exactextractr")
I'm trying to use plot.ci function in the zelig library but apparently Zelig is not supported with R 4.0.2. I'm trying to see if there is a work around to access these functions or if I just can't use this library until they make the appropriate updates. Please help.
Ethan
Error message below:
> install.packages('zeligverse')
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 package into ‘C:/Users/ethan/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘zeligverse’ is not available (for R version 4.0.2)
It looks like this package has been removed from CRAN's repository, meaning you can't install it like this anymore - you have to install it manually. This is explained on their website, and has download links for manual installation that have been archived:
https://cran.r-project.org/web/packages/zeligverse/index.html
You will also have to install the following dependencies (packages it requires) to install it correctly:
'Amelia', 'MatchIt', 'WhatIf', 'Zelig', 'ZeligChoice', 'ZeligEI'
The Zelig package that is currently available appears to support the function you mentioned. You can install it with:
install.packages("Zelig")
Since updating R to 3.1 having trouble installing automap package on a mac.
> install.packages("automap")
package ‘automap’ is available as a source package but not as a binary
Warning in install.packages :
package ‘automap’ is not available (for R version 3.1.0)
Cannot workout how to install from source - can anyone help please ?
Update: Ok I got this to install eventually by downloading the source and using R CMD INSTALL at the command line. But I had to manually install gstat and spacetime this way first. When in Rstudio and using the package install tool via the menu - none of these packages come up in the list of packages on CRAN - why is this happening ? I did not have to do all this in R 2.15 that I can recall. Any ideas anyone ?
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.
I am getting the following error when trying to install ggplot2:
> install.packages("ggplot2")
Installing package(s) into ‘/home/dodo/R/x86_64-pc-linux-gnu-library/2.13’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... done
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘ggplot2’ is not available (for R version 2.13.1)
I am running Ubuntu 11.10 (oneiric).
Any help is appreciated.
You need R (>= 2.14.0) for this version.
So please go and see the instructions at CRAN to upgrade on Ubuntu to the current R and once you have R 2.14.2 up and running (which is a matter of four or five commands, thanks to the magic of apt-get and friends, upgrade to the current ggplot2.
ggplot2-0.9.0 has an explicit dependency on R >= 2.14 (and an implicit one of R >= 2.14.1). Thus it can not be installed in R version 2.13.1. Perhaps you can get the previous version (0.8.9) from the archives and install that.
You need to install a version that is appropriate to your old version of R or you need to upgrade. To go the first route, you should find a version of ggplot2 in the Archives and then install from source (which is I believe the default for Linux). Perhaps try the UCLA CRAN mirror:
http://cran.stat.ucla.edu/src/contrib/Archive/ggplot2/ggplot2_0.8.9.tar.gz