R/app_config.R

Defines functions get_golem_config app_sys

#' Access files in the current app
#'
#' @param ... character vectors, specifying subdirectory and file(s)
#' within your package. The default, none, returns the root of the app.
#'
#' @noRd
app_sys <- function(...) {
    system.file(..., package = "tcgaViz")
}


#' Read App Config
#'
#' @param value Value to retrieve from the config file.
#' @param config GOLEM_CONFIG_ACTIVE value. If unset, R_CONFIG_ACTIVE.
#' If unset, "default".
#' @param use_parent Logical, scan the parent directory for config file.
#'
#' @noRd
get_golem_config <- function(
    value,
    config = Sys.getenv(
        "GOLEM_CONFIG_ACTIVE",
        Sys.getenv(
            "R_CONFIG_ACTIVE",
            "default"
        )
    ),
    use_parent = TRUE) {
    config::get(
        value = value,
        config = config,
        file = app_sys("golem-config.yml"),
        use_parent = use_parent
    )
}

Try the tcgaViz package in your browser

Any scripts or data that you put into this service are public.

tcgaViz documentation built on April 4, 2023, 5:14 p.m.