activateEnvironment: Activate a Conda environment

Description Usage Arguments Details Value Author(s) Examples

View source: R/activateEnvironment.R

Description

Mimic the (de)activation of a Conda environment by modifying environment variables in the current R process.

Usage

1
2
3

Arguments

envpath

String containing the path to the Conda environment to activate. If NULL, the base Conda instance at getCondaDir() is activated.

loc

String containing the path to the root of a conda instance.

listing

Named list of strings containing name:value pairs for environment variables, typically the output of activateEnvironment.

Details

Conda environments generally need to be activated to function properly. This is especially relevant on Windows where the "PATH" variable needs to be modified for the DLL search. The .activateEnvironment function mimics the effect of activation by modifying environment variables in the current R session. This can be reversed by .deactivateEnvironment once the Conda environment is no longer in use.

The .activateEnvironment function will also unset a few bothersome environment variables:

Value

activateEnvironment will modify environment variables to mimic activation of the Conda environment. It returns a named list of the previous values of all variables modified in this manner. (NA values indicate that the corresponding variable was not previously set.)

deactivateEnvironment restores the environment variables to their pre-activation state. It returns NULL invisibly.

Author(s)

Aaron Lun

Examples

1
2
3
4
# We can't actually run activateEnvironment() here, as it 
# either relies on basilisk already being installed or
# it has a hard-coded path to the basilisk system dir.
print("dummy test to pass BiocCheck")

LTLA/basilisk.utils documentation built on June 10, 2021, 8:41 p.m.