| findCRANmirror {utils} | R Documentation | 
Find CRAN Mirror Preference
Description
Find out if a CRAN mirror has been selected for the current session.
Usage
findCRANmirror(type = c("src", "web"))
Arguments
| type | Is the mirror to be used for package sources or web information? | 
Details
Find out if a CRAN mirror has been selected for the current session. If so, return its URL else return ‘"https://CRAN.R-project.org"’.
The mirror is looked for in several places.
- The value of the environment variable R_CRAN_SRC or R_CRAN_WEB (depending on - type), if set.
- An entry in - getOption("repos")named ‘CRAN’ which is not the default ‘"@CRAN@")’.
- The ‘CRAN’ URL entry in the ‘repositories’ file (see - setRepositories), if it is not the default ‘"@CRAN@"’.
The two types allow for partial local CRAN mirrors, for example those
mirroring only the package sources where getOption("repos")
might point to the partial mirror and R_CRAN_WEB point to
a full (remote) mirror.
Value
A character string.
See Also
setRepositories, chooseCRANmirror
Examples
c(findCRANmirror("src"), findCRANmirror("web"))
Sys.setenv(R_CRAN_WEB = "https://cloud.r-project.org")
c(findCRANmirror("src"), findCRANmirror("web"))