1
2
3#' @export
4#' @rdname bioc_install_repos
5#' @keywords internal
6#' @examples
7#' bioc_version()
8#' bioc_version("3.4")
9
10bioc_version <- function(r_ver = getRversion()) {
11  bioconductor$get_bioc_version(r_ver)
12}
13
14#' Tools for Bioconductor repositories
15#'
16#' `bioc_version()` returns the Bioconductor version for the current or the
17#' specified R version.
18#'
19#' `bioc_install_repos()` deduces the URLs of the Bioconductor repositories.
20#'
21#' @details
22#' Both functions observe the `R_BIOC_VERSION` environment variable, which
23#' can be set to force a Bioconductor version. If this is set, then the
24#' `r_ver` and `bioc_ver` arguments are ignored.
25#'
26#' `bioc_install_repos()` observes the `R_BIOC_MIRROR` environment variable
27#' and also the `BioC_mirror` option, which can be set to the desired
28#' Bioconductor mirror. The option takes precedence if both are set. Its
29#' default value is `https://bioconductor.org`.
30#'
31#' @return
32#' `bioc_version()` returns a Bioconductor version, a `package_version`
33#' object.
34#'
35#' `bioc_install_repos()` returns a named character vector of the URLs of
36#' the Bioconductor repositories, appropriate for the current or the
37#' specified R version.
38#'
39#' @param r_ver R version to use. For `bioc_install_repos()` it is
40#'   ignored if `bioc_ver` is specified.
41#' @param bioc_ver Bioconductor version to use. Defaults to the default one
42#'   corresponding to `r_ver`.
43#'
44#' @export
45#' @keywords internal
46#' @examples
47#' bioc_install_repos()
48
49bioc_install_repos <- function(r_ver = getRversion(),
50                               bioc_ver = bioc_version(r_ver)) {
51  bioconductor$get_repos(bioc_ver)
52}
53