getTemp {svMisc}R Documentation

Get a temporary variable from the TempEnv environment

Description

The function gets a variable from TempEnv, an environment dedicated to temporary variables.

Usage

    getTemp(x, default = NULL, mode = "any")

Arguments

x The name of the variable
default The default value to return, in case the variable does not exist
mode The mode of the variable (if the variable exists, but is not of correct mode, nothing is retrieved). Use mode = "any" (default value) to retrieve the variable whatever its mode.

Value

The content of the variable, or the default value if the variable is not found in TempEnv.

Author(s)

Philippe Grosjean <phgrosjean@sciviews.org>

See Also

TempEnv, assignTemp, rmTemp, existsTemp

Examples

        assignTemp("test", TRUE)
        # Retrieve this variable
        getTemp("test")
        # Retrieve a non existing variable (returns default value)
        getTemp("nonexistant", default = "default value")

[Package svMisc version 0.9-5 Index]