igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Delete all attributes


From: Chris Watson
Subject: [igraph] Delete all attributes
Date: Thu, 20 Aug 2015 03:09:25 -0400

Is there a function to delete *all* attributes of a graph (graph, vertex, and edge level)? If not, is the way to do it, e.g.

delete_all_attr <- function(g) {
  for (att in graph_attr_names(g)) g <- delete_graph_attr(g, att)
  for (att in vertex_attr_names(g)) g <- delete_vertex_attr(g, att)
  for (att in edge_attr_names(g)) g <- delete_edge_attr(g, att)
  return(g)
}

Thanks,
Chris

reply via email to

[Prev in Thread] Current Thread [Next in Thread]