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 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"))


[Package utils version 4.4.1 Index]