Learn R Programming

svMisc (version 0.9-46)

changeTemp: Change an item in a temporary list variable

Description

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

Usage

changeTemp(x, item, value, replace.existing = TRUE)

Arguments

x
The name of the variable containing the list
item
The item to change (or create) in the list
value
The value to put in the list item
replace.existing
Do we replace an existing item?

See Also

TempEnv, assignTemp, getTemp, existsTemp, rmTemp, addTemp, tempvar

Examples

Run this code
changeTemp("tst", "item1", 1:10)
# Retrieve this variable
getTemp("tst")
# Create another item in the list
changeTemp("tst", "item2", TRUE)
getTemp("tst")
# Change it
changeTemp("tst", "item2", FALSE)
getTemp("tst")
# Delete it (= assign NULL to it)
changeTemp("tst", "item2", NULL)
getTemp("tst")
# Delete the whole variable
rmTemp("tst")

Run the code above in your browser using DataLab