I tried to install a package, using
install.packages("foobarbaz")
but received the warning
Warning message:
package 'foobarbaz' is not available (for R version x.y.z)
Why doesn't R think that the package is available?
See also these questions referring to specific instances of this problem:
My package doesn't work for R 2.15.2
package 'Rbbg' is not available (for R version 2.15.2)
package is not available (for R version 2.15.2)
package doMC NOT available for R version 3.0.0 warning in install.packages
Dependency ‘Rglpk’ is not available for package ‘fPortfolio’
What to do when a package is not available for our R version?
Is the bigvis package for R not available for R version 3.0.1?
package ‘syncwave’/‘mvcwt’ is not available (for R version 3.0.2)
package ‘diamonds’ is not available (for R version 3.0.0)
Is the plyr package for R not available for R version 3.0.2?
https://stackoverflow.com/questions/21580661/installing-predictabel-package-on-r-2-15-2
Package bigmemory not installing on R 64 3.0.2
package "makeR" is not available (for version 3.0.2)
package ‘RTN’ is not available (for R version 3.0.1)
Trouble Installing geoR package
package ‘twitterR’ is not available (for R version 3.1.0)
How to install 'Rcpp, package? I got "package is not available"
package ‘dataset’ is not available (for R version 3.1.1)
"package ‘rhipe’ is not available (for R version 3.1.2)"
https://stackoverflow.com/questions/31439092/package-dplyr-is-not-available-for-r-version-3-1-1
I had the same problem (on Linux) which could be solved changing the proxy settings. If you are behind a proxy server check the configuration using
Sys.getenv("http_proxy")
within R. In my~/.Renviron
I had the following lines (from https://support.rstudio.com/hc/en-us/articles/200488488-Configuring-R-to-Use-an-HTTP-or-HTTPS-Proxy) causing the problem:Changing it to
solved the problem. You can do the same for
https
.It was not the first thought when I read "package xxx is not available for r version-x-y-z" ...
HTH
As mentioned here (in French), this can happen when you have two versions of R installed on your computer. Uninstall the oldest one, then try your package installation again! It worked fine for me.
This solution might break R but here is an easiest solution that works 99% of time.
You need to do is just:
As mentioned by the author over here
This saved me a lot of time debugging what's wrong. In many cases are just mirrors out of date. This function can install multiple packages with their dependencies using
https://cran.rstudio.com/
:Another minor addition, while trying to test for an old R version using the docker image
rocker/r-ver:3.1.0
repos
setting isMRAN
and this fails to get many packages.https
, so, for example:install.packages("knitr", repos = "https://cran.rstudio.com")
seems to work.This is what I finally could do for installing psych package in R-3.4.1 when I got the same warning
1:Googled for that package.
2:downloaded it manually having tar.gz extension
3:Chose the option "Package Archive File (.zip;.tar.gz)" for install packages in R
4:browsed locally to the place where it was downloaded and clicked install
You may get a warning: dependencies 'xyz' not available for the package ,then first install those from the repository and then do steps 3-4 .