igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Delete all attributes


From: Tamas Nepusz
Subject: Re: [igraph] Delete all attributes
Date: Fri, 21 Aug 2015 21:47:46 +0200

Hi Chris,

Yes, that's the way to do it - we have no dedicated function for this.
However, you can also create a new graph from the edge list of the old
graph, which is effectively the same thing (I guess), and it is
probably faster.

T.
T.


On Thu, Aug 20, 2015 at 9:09 AM, Chris Watson <address@hidden> wrote:
> 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
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>



reply via email to

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