Learn R Programming

SciViews (version 0.8-8)

getTemp: 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.

See Also

TempEnv, assignTemp, rmTemp, existsTemp

Examples

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

Run the code above in your browser using DataLab