Last chance! 50% off unlimited learning
Sale ends in
getTemp(x, default = NULL, mode = "any", item = NULL)
mode = "any"
(default value) to retrieve the variable or item whatever its mode.NULL
(default), the whole variable content is retrieve,
otherwise, the variable is considered as a list, and the corresponding item
from that list is returned. In this case, default
and mode
aTempEnv
, 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"))
Run the code above in your browser using DataLab