addTemp: Add data to an item in a temporary list variable

Description Usage Arguments Author(s) See Also Examples

View source: R/addTemp.R

Description

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

Usage

1
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 <[email protected]>

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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")

svMisc documentation built on May 29, 2017, 12:18 p.m.