igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Delete all attributes


From: Chris Watson
Subject: Re: [igraph] Delete all attributes
Date: Sat, 22 Aug 2015 13:01:51 -0400

Thanks. My use case would be after using "rewire" to create a random graph. I work w/ pretty small graphs so it only takes a couple milliseconds to delete them all.

On Fri, Aug 21, 2015 at 3:47 PM, Tamas Nepusz <address@hidden> wrote:
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
>

_______________________________________________
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]