| getTemp {svMisc} | R Documentation |
The function gets a variable, or an item in a list variable from SciViews:TempEnv, an environment dedicated to temporary variables.
getTemp(x, default = NULL, mode = "any", item = NULL)
x |
the name of the variable. |
default |
the default value to return, in case the variable or the item does not exist. |
mode |
the mode of the variable or the item (if the variable exists, but
is not of correct mode, the default value is returned). Use
|
item |
if |
The content of the variable, of the item, or the default value if the variable or item is not found in SciViews:TempEnv, or of the wrong mode.
Philippe Grosjean <phgrosjean@sciviews.org>
TempEnv, assignTemp, changeTemp,
rmTemp, existsTemp, addTemp
assignTemp("test", 1:10)
## Retrieve this variable
getTemp("test")
## Retrieve a non existing variable (returns default value)
getTemp("nonexistant", default = "default value")
## Set and retrieve items from a list
changeTemp("test2", "item1", 1:5)
getTemp("test2", item = "item1")
## Compare to:
getTemp("test2")
## Remove temporary variables
rmTemp(c("test", "test2"))