Learn R Programming

loon (version 1.4.1)

l_layer_delete: Delete a layer

Description

All but the 'model' and the 'root' layer can be dynamically deleted. If a group layer gets deleted with l_layer_delete then all its children layers get moved into their grandparent group layer.

Usage

l_layer_delete(widget, layer)

Value

0 if success otherwise the function throws an error

Arguments

widget

widget path or layer object of class 'l_layer'

layer

layer id. If the widget argument is of class 'l_layer' then the layer argument is not used

See Also

l_layer, l_info_states

Examples

Run this code
if(interactive()){

p <- l_plot()
l1 <- l_layer_rectangle(p, x = 0:1, y = 0:1, color='red')
l_layer_delete(l1)

l2 <- l_layer_rectangle(p, x = 0:1, y = 0:1, color='yellow')
l_layer_delete(p,l2)

}

Run the code above in your browser using DataLab