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
Related
I have a problem using renv. For a larger project we want to use renv to all have the same version of r and all our packages. Yet, as soon as a newer version of a package is available and we run renv::restore() we get an error like the following (please note: rcpparmadillo is not the only package. It also happens with greybox, mime, stringi and many more).
Error installing package 'RcppArmadillo':
=========================================
* installing *source* package 'RcppArmadillo' ...
** Package 'RcppArmadillo' successfully unpacked and MD5 sums checked
** using staged installation
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** libs
Warning in system(paste(cmd, "shlib-clean")) 'make' not found
Warning in system(cmd) 'make' not found
ERROR: compilation failed for package 'RcppArmadillo'
* removing 'C:/Users/..../renv/staging/1/RcppArmadillo'
Error: install of package 'RcppArmadillo' failed
I now have two questions:
How can I fix this error?
How can we use the same versions of packages throughout our team if renv crashes everytime a newer version is available?
Thank you.
Lizzie
The ultimate issue here is that renv is trying to install these packages from sources, as binaries for these older packages are no longer available from CRAN. There are two potential solutions to this issue:
Consider using a MRAN checkpoint as your R repository. The plus side is that binaries for these older packages will remain available; the downside is that you won't be informed if newer packages do become available.
Install the requisite software so you can build these packages from sources.
For 2. on Windows, you will need to install Rtools:
https://cran.r-project.org/bin/windows/Rtools/
You can also use the renv::equip() function to download a variety of libraries needed to compile some packages from sources (for example, nloptr).
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.
I am trying to install the CRAN Hmisc package in an R Environment Notebook on IBM Watson Studio. But it repeatedly fails with the following Error:
install.packages('Hmisc')
also installing the dependencies ‘checkmate’, ‘rstudioapi’, ‘Formula’, ‘latticeExtra’, ‘acepack’, ‘gridExtra’, ‘htmlTable’, ‘viridis’
Warning message in install.packages("Hmisc"):
“installation of package ‘viridis’ had non-zero exit status”Warning message in install.packages("Hmisc"):
“installation of package ‘Hmisc’ had non-zero exit status”Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
I tried to separately install the viridis package and that also fails with the same error:
install.packages('viridis')
Warning message in install.packages("viridis"):
“installation of package ‘viridis’ had non-zero exit status”Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
What I did was go down a version of the library using devtools:
require(devtools)
install_version('Hmisc', version = "4.1-0")
Then I installed it again:
install.package('Hmisc')
You can then load the library library('Hmisc') and run sessionInfo() to see that you're running the latest version. It's a workaround and I don't know why it initially doesn't want to install. Perhaps it has something to do with R in DSX using version 3.3.2 and some libraries are missing? I haven't a clue.
In turns out to be an incorrect dependency management on viridis. It has a dependency over viridisLite >= 0.2.0. Latest viridis is expecting an object called cividis which was only added on the latest version of viridisLite > 0.2.0. DSX has viridisLite==0.2.0 already installed. Hence, the install of viridis fails. So basically, explicitly installing a newer version of viridisLite solves the issue.
install.packages(c('viridisLite', 'Hmisc'))
TL;DR - Install latest viridisLite and then install Hmisc
I am trying to install an R package for autonomous processing of Twitter data with the help of TwitteR2Mongo, but I'm getting the following error:
Warning in install.packages :
package ‘TwitteR2Mongo’ is not available (for R version 3.4.3)
package may not have been published to CRAN. but it builds from github for me on 3.4.3.
try
install.packages("devtools")
library(devtools)
install_github("ProjectTw/TwitteR2Mongo")
I install old version of R (windows version 2.7.0).
For using bioconductor in R, use source("http://bioconductor.org/getBioC.R")
biocLite("GO.db")
library("GO.db")
When I load GO.db, it gives error:
Loading required package: AnnotationDbi
Error: package 'DBI' required by 'AnnotationDbi' could not be found
How can I solve this problem? Please Help.
R packages are often require or depend upon other packages. For example, GO.db requires AnnotationDbi. When a package in Bioconductor requires another Bioconductor package, it will usually just install both of them at the same time.
Unfortunately, there are times when a package from Bioconductor requires a package from CRAN, and you will need to install each package separately. In this case, DBI is required by AnnotationDbi, but it is on CRAN.
Try installing DBI:
install.packages("DBI")
Then try loading GO.db. You may have to re-install AnnotationDbi again to get it to work.