R: Can't use 0-cloud to install.packages
When I try to install packages from 0-cloud it doesn't work
> install.packages("lfactors")
--- Please select a CRAN mirror for use in this session ---
then i select 0-cloud from the repository list. and R returns
Warning: unable to access index for repository https://cran.rstudio.com/src/contrib
Warning: unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/3.2
Warning message:
package βlfactorsβ is not available (for R version 3.2.1)
But when I run this code and select a different repository, it works.
I tried to disable my proxy and visit the site with the proxy and I cannot visit it in the browser without issue.
Any ideas?
Edit: based on the comment, I ran this
capabilities()["libcurl"]
libcurl
TRUE
Therefore, I think that it is not so.
source to share
Perhaps your R file was built without curl support and you cannot access the https servers. See what this returns:
R> capabilities()["libcurl"]
libcurl
TRUE
R>
If that's for you FALSE
, do two things:
-
Change
options("repos")
to use http instead of https. -
Rebuild R to have libcurl support.
I am doing this in Rprofile.site
:
## Example of Rprofile.site
local({
r <- getOption("repos")
r["CRAN"] <- "http://cran.rstudio.com" ## not https for you
options(repos = r)
})
Edit: Another possibility, especially on Windows, is that internet2 dll needs to be activated, so it's recommended to use it setInternet2(TRUE)
once.
source to share