R/activate_conda.R

Defines functions activate_conda

Documented in activate_conda

#' Activate conda environment
#'
#' Activate a conda environment using a global variable.
#' @returns Null
#' @inheritParams echoconda::activate_env
#'
#' @export
#' @examples
#' activate_conda()
activate_conda <- function(conda_env = Sys.getenv("CONDA_ENV"),
                           method = "reticulate",
                           verbose = TRUE){

  #### Set default conda env ####
  if(conda_env=="") conda_env <- "r-reticulate"
  #### Only activate if not already activated ####
  if(echoconda::which_env()!=conda_env){
    echoconda::activate_env(conda_env = conda_env,
                            method = method,
                            verbose = verbose)
  }
}
bschilder/scKirby documentation built on Oct. 2, 2024, 10:16 p.m.