Warning: unable to access index for repository https://www.stats.ox.ac.uk/pub/RWin/src/contrib:
I'm guessing this is a temporary issue (but an annoying one nonetheless and one that I dealt with this morning). That repository is most likely an additional one set alongside the "CRAN" repository as "CRANextra". The solution is to redefine the repos option to not include CRANextra. You can use the setRepositories()
command and unselect "CRANextra". Alternatively you could just run the following code which will remove all repositories except the "CRAN"selection.
options(repos=getOption("repos")["CRAN"])
Problems with installation R packages
This is something that pops up in R and RStudio only once in a while. RStudio changes quite a few settings, and the option "repos"
is one of them. On Windows, the following is added
EDIT: It's not RStudio adding this extra repository. The repository is kindly provided by Dr. Brian Ripley for packages that for some reason can't be made available on CRAN (license, not building out of the box, requiring additional software, ...). This is called "CRANextra" in the settings:
> getOption("repos")
CRAN CRANextra
"https://cran.rstudio.com/" "http://www.stats.ox.ac.uk/pub/RWin"
attr(,"RStudio")
[1] TRUE
So RStudio tries to access a specific repository when run on Windows, but that repository has had some connection issues in the past; it isn't always reachable, and when it's not, the warnings you report are issued.
You can get this warning to stop by resetting this option:
options(repos = "https://cran.rstudio.com") # or a repo of your choice.
Which allows you to install packages without the warning:
> install.packages("fortunes")
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/fortunes_1.5-4.zip'
Content type 'application/zip' length 202721 bytes (197 KB)
downloaded 197 KB
package ‘fortunes’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Joris\AppData\Local\Temp\Rtmpu0febg\downloaded_packages
Even when this warning is displayed, packages still get installed from the rstudio CRAN mirror. The warning is reported as a bug, and RStudio has promised to tackle it soon.
EDIT: More information on the CRANextra repository in R FAQ (last paragraph):
Some CRAN packages that do not build out of the box on Windows,
require additional software, or are shipping third party libraries for
Windows cannot be made available on CRAN in form of a Windows binary
packages. Nevertheless, some of these packages are available at the
“CRAN extras” repository at https://www.stats.ox.ac.uk/pub/RWin/
kindly provided by Brian D. Ripley. Note that this repository is a
default repository for recent versions of R for Windows.
Cant able to install R package 'dplyr' in windows 8 os
Finall i have solved this problem by using the default download method to "libcurl"
options(download.file.method="libcurl")
Related Topics
Adding Regression Line Equation and R2 on Separate Lines Graph
R Ggplot Boxplot: Change Y-Axis Limit
Format Latitude and Longitude Axis Labels in Ggplot
How to Apply a Hierarchical or K-Means Cluster Analysis Using R
Passing a 'Data.Table' to C++ Functions Using 'Rcpp' And/Or 'Rcpparmadillo'
Use Href Infobox as Actionbutton
Names' Attribute Must Be the Same Length as the Vector
Dplyr Count Number of One Specific Value of Variable
Why Is the Class of a Vector the Class of the Elements of the Vector and Not Vector Itself
With the R Package Xlsx, How to Set Na.Strings When Reading an Excel File
R: Save Multiple Plots from a File List into a Single File (Png or PDF or Other Format)
Setting Ld_Library_Path from Inside R
Dplyr Filter() with SQL-Like %Wildcard%
Select Random Element in a List of R
Different Results with Randomforest() and Caret's Randomforest (Method = "Rf")
Understanding Dates/Times (Posixc and Posixct) in R