l_layer_delete {loon}R Documentation

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)

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

Value

0 if success otherwise the function throws an error

See Also

l_layer, l_info_states

Examples

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)

}

[Package loon version 1.4.1 Index]