addTemp {svMisc}R Documentation

Add data to an item in a temporary list variable

Description

The function adds data to an item in a list variable located in TempEnv, an environment dedicated to temporary variables (especially useful for GUIs).

Usage

addTemp(x, item, value, use.names = TRUE, replace = TRUE)

Arguments

x The name of the variable containing the list
item The item to add data to in the list
value The value to add in the item, it must be a named vector and element matching is done according to name of items
use.names Do we match items in the existing vector and the vector we add by means of its names or its values?
replace Do we replace existing items?

Author(s)

Philippe Grosjean <phgrosjean@sciviews.org>

See Also

TempEnv, assignTemp, getTemp, existsTemp, rmTemp, changeTemp, tempvar

Examples

addTemp("tst", "item1", c(a = 1, b = 2))
# Retrieve this variable
getTemp("tst")
# Add to item1 in this list without replacement
addTemp("tst", "item1", c(a = 45, c = 3), replace = FALSE)
getTemp("tst")
# Same but with replacement of existing items
addTemp("tst", "item1", c(a = 45, c = 3), replace = TRUE)
getTemp("tst")
# Delete the whole variable
rmTemp("tst")

[Package svMisc version 0.9-46 Index]