Install package dependency that has no binary version - r

I am trying to set up a packrat project but it keeps failing because one of the packages (installed from GitHub) depends on a package that doesn't currently have a binary version on CRAN. This is the error message I receive:
> remotes::install_github("BroVic/raampGBV")
Downloading GitHub repo BroVic/raampGBV#master
Skipping 1 packages not available: naijR
Installing 114 packages: DBI, RSQLite, ...
Installing packages into ‘C:/Users/Admn/project/packrat/lib/x86_64-w64-mingw32/3.6.2’
(as ‘lib’ is unspecified)
package ‘naijR’ is available as a source package but not as a binary
There are binary versions available (and will be
installed) but the source versions are later:
binary source
digest 0.6.23 0.6.24
stringi 1.4.4 1.4.5
callr 3.4.1 3.4.2
ps 1.3.0 1.3.1
Error: Failed to install 'raampGBV' from GitHub:
(converted from warning) package ‘naijR’ is not available (as a binary package for R version 3.6.2)
Again, to be clear, raampGBV exists only on GitHub (it's a project-specific package) while naijR is on CRAN. When I try to install raampGBV on its own, the naijR source package is downloaded and installed from CRAN without any issue. But when attempted via packrat, it fails.

According to NEWS for R 3.6.2:
For a Windows or Mac OS X binary package install, install.packages()
will check if a source package is available on the same repositories,
and report if it is a later version or there is a source package but
no binary package available. This check can be suppressed: see the
help page.
Upon examining the Binary packages section of ?install.packages(), it is evident that the type parameter is what is used to control the behaviour referred to in the quote above. The default argument for type in install.packages is getOption("pkgType"), which in my case returned "win.binary". This is how the issue was fixed:
oldOpt <- getOption("pkgType")
options(pkgType = "both")
remotes::install_github("BroVic/raampGBV")
options(pkgType = oldOpt)
The dependencies are now properly installed in the packrat library.

Related

Can't install any R package with jupyter notebook

I get this error whenever I try to install any package with jupyter notebook
There is a binary version available but the source version is later:
binary source needs_compilation
Rcpp 1.0.6 1.0.8 TRUE
installing the source package 'Rcpp'
Warning message in install.packages("Rcpp"):
"installation of package 'Rcpp' had non-zero exit status"
For this specific package, I was able to install it with conda install but some packages like lifecontingencies doesen't work and I get this message with install.packages('lifecontingencies')
also installing the dependencies 'Rcpp', 'markovchain'
There are binary versions available but the source versions are later:
binary source needs_compilation
Rcpp 1.0.6 1.0.8 TRUE
markovchain 0.8.5-4 0.8.6 TRUE
lifecontingencies 1.3.7 1.3.8 TRUE
installing the source packages 'Rcpp', 'markovchain', 'lifecontingencies'
Warning message in install.packages("lifecontingencies"):
"installation of package 'Rcpp' had non-zero exit status"Warning message in install.packages("lifecontingencies"):
"installation of package 'markovchain' had non-zero exit status"Warning message in install.packages("lifecontingencies"):
"installation of package 'lifecontingencies' had non-zero exit status"
And I get this with Conda
Is there a way to fix the install.packages command in jupyter notebook ?
My R version is 3.6.1 (2019-07-05)
The CRAN package lifedependencies is now available through Conda Forge.1 I generally recommend that all Conda R environments should source packages from Conda, otherwise one is likely to encounter compilation (really, library linking) issues.
conda install -c conda-forge r-lifedependencies
However, note that this is only available for R 4.0 and 4.1 at this time. If an R 3.6 version truly is required, then please request it by filing an Issue on the feedstock.
For future reference, there are some details on adding CRAN packages to Conda Forge in this answer.
[1]: Note that R packages are typically prefixed with r- in the Conda ecosystem.

Warning in install.packages : package ‘rattle’ is not available (for R version 3.4.4)

I was trying to install.packages("rattle")
but it shows this :
Installing package into ‘/home/shahin/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘rattle’ is not available (for R version 3.4.4)
I am in ubuntu 18.04. I also tried to install RGtk2 that also shows error. How can i install rattle?
rattle requires R version 3.5.0 or higher.
Update R to the latest version, then you'll be able to install it.
You need to update your R version following these instructions : Ubuntu Packages for R. Pay attention to the Secure APT section.
Please run below commands in order to update your version:
install.packages("installr")
library(installr)
updateR()
This will start the updating process of your R installation by: “finding the latest R version, downloading it, running the installer, deleting the installation file, copy and updating old packages to the new R installation.”

Package ‘Rstem’ is not available (for R version 3.5.1)

I am trying to install the Rstem package, but I am getting the message that there is no version available for the version of R 3.5.1. I'm using the macOs El Captain.
The error is:
> install.packages('Rstem', repos = 'https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz')
Installing package into ‘/Users/ls_rafael/Library/R/3.5/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
unable to access index for repository https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/src/contrib:
cannot open URL 'https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/src/contrib/PACKAGES'
Warning in install.packages :
package ‘Rstem’ is not available (for R version 3.5.1)
Warning in install.packages :
unable to access index for repository https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/bin/macosx/el-capitan/contrib/3.5:
cannot open URL 'https://cran.r-project.org/src/contrib/Archive/Rstem/Rstem_0.4-1.tar.gz/bin/macosx/el-capitan/contrib/3.5/PACKAGES'
I already tried the suggested options in this link issues in installing Rstem package and also downloading the package locally from the official website Rstem Package, but the result is also unsatisfactory.
I'm studying how to do an sentiment analysis with Twitter data. I would like to know if there is any alternative to this package or if there is any trick to install it.
RStem package has been removed from the CRAN repository. You can download using the following command:-
install.packages('Rstem', repos = "http://www.omegahat.net/R")
Make sure you have RTools installed on your machine. You can download it from this link -
Building R for Windows
RStem is now provided by OmegaHat.
Try the command below:
install.packages("Rstem", repos = "http://www.omegahat.net/R", type = "source")

error information when installing packages

I am puzzled about the following description:
_ERROR: dependency 'SuppDists' is not available for package 'kSamples'
removing 'F:/R-3.5.1/library/kSamples' In R CMD INSTALL_
Is my edition too old?For I have downloaded one package successfully called"crank" with the option"install package from the local files"
And then the others all failed.
And what about the package which are not released on CRAN Package?
Thanks for answering!
Try installing from CRAN rather than a local download. This is most commonly done using the install.packages command:
install.packages("kSamples", dependencies = TRUE)
This should take care of any installing dependencies (i.e. other packages that your package needs to function).
If the package is not available from CRAN, then try installing the devtools package from CRAN. This will allow you to use other repositories such as Github. To do this you will first need to install and dependencies that the package requires, then install the package you are after.
install.packages("devtools")
require(devtools) # load devtools
install_github("username/dependency_repo") # install dependencies
install_github("username/package_repo") # install package

Install package "rio" because of feather

I try in R to install the CRAN-packages "rio" but receive the following error:
install.packages("rio", dependencies = TRUE)
Installing package into ‘C:/software/Rpackages’
(as ‘lib’ is unspecified)
also installing the dependency ‘feather’
There is a binary version available but the source
version is later:
binary source needs_compilation
rio 0.4.0 0.4.8 FALSE
Package which is only available in source form, and may
need compilation of C/C++/Fortran: ‘feather’
These will not be installed
installing the source package ‘rio’
trying URL 'https://cran.rstudio.com/src/contrib/rio_0.4.8.tar.gz'
Content type 'application/x-gzip' length 40366 bytes (39 KB)
downloaded 39 KB
ERROR: dependency 'feather' is not available for package 'rio'
* removing 'C:/software/Rpackages/rio'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.4RE/bin/x64/R" CMD INSTALL -l "C:\software\Rpackages" C:\Users\BJRNAU~1\AppData\Local\Temp\Rtmp6rf71B/downloaded_packages/rio_0.4.8.tar.gz' had status 1
Warning in install.packages :
installation of package ‘rio’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\BjørnAugust\AppData\Local\Temp\Rtmp6rf71B\downloaded_packages’
Can anyone help me install the packages?
This was an unintended consequence of importing feather in the latest release of rio. It will be correctly soon in the next release of rio to CRAN (v0.4.11), which should be available by 10 August 2016. In the meantime, you have a couple of options.
1) Install the development version from GitHub using something like:
devtools::install_github("leeper/rio")
# or
remotes::install_github("leeper/rio")
This version (v0.4.11) makes feather optional, so it is installable on older Windows versions.
2) Install an older version of rio:
packageurl <- "https://cran.r-project.org/src/contrib/Archive/rio/rio_0.4.6.tar.gz"
install.packages(packageurl, repos=NULL, type="source")
But note that this will potentially require manual install of package dependencies.
3) Upgrade to the latest version of R (v3.3.1) so that you can install feather (and thus rio).

Resources