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)
}
Run the code above in your browser using DataLab