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.

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

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