R: Change an item in a temporary list variable

changeTemp {svMisc} | R Documentation

## Change an item in a temporary list variable

### Description

The function changes an item in a list variable located in SciViews: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?

### Author(s)

Philippe Grosjean <phgrosjean@sciviews.org>

### See Also

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

### Examples

    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")

[Package svMisc version 0.9-70 Index]