l_layer_expunge: Delete a layer and all its descendants

View source: R/l_layer.R

l_layer_expungeR Documentation

Delete a layer and all its descendants

Description

Delete a group layer and all it's descendants. Note that the 'model' layer cannot be deleted.

Usage

l_layer_expunge(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_layer_delete

Examples

if(interactive()){

p <- l_plot()
g <- l_layer_group(p)
l1 <- l_layer_rectangle(p, x=0:1, y=0:1, parent=g, color="", linecolor="orange", linewidth=2)
l2 <- l_layer_line(p, x=c(0,.5,1), y=c(0,1,0), parent=g, color="blue")

l_layer_expunge(p, g)

# or l_layer_expunge(g)

}

loon documentation built on July 9, 2023, 5:48 p.m.