From #2006
library(igraph)
g <- make_ring(5)
V(g)$color <- "red"
# what a user might try, expecting it to remove the attribute (like df$col <- NULL)
V(g)$color <- NULL
V(g)$color
# the actual current way to remove a vertex attribute
g <- delete_vertex_attr(g, "color")
V(g)$color
On the stoop2 branch: V(g)$color <- NULL silently does nothing (still prints "red" "red" "red" "red"
"red"), while delete_vertex_attr(g, "color") correctly removes it (V(g)$color then errors with "color" is
not a graph attribute, or similar — since the attribute no longer exists).
I wonder whether using <- NULL should become possible (instead of just erroring).
From #2006
On the stoop2 branch: V(g)$color <- NULL silently does nothing (still prints "red" "red" "red" "red"
"red"), while delete_vertex_attr(g, "color") correctly removes it (V(g)$color then errors with "color" is
not a graph attribute, or similar — since the attribute no longer exists).
I wonder whether using
<- NULLshould become possible (instead of just erroring).