igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Automating sequence of commands


From: Víctor Pascual Cid
Subject: Re: [igraph] Automating sequence of commands
Date: Thu, 19 Jan 2012 09:45:48 +0100

Hi Cadu.

Something like this should work for you.

processGraph <- function(g) {
        g$density<-graph.density(g)
        g$diameter<-diameter(g)
        V(g)$ articulation.points <-0
        V(g)[articulation.points(g)]$ articulation.points <-1

        return(g);
}

Save into a file called processGraph.R and load it in R using 
source("processGraph.R") so you can use it with any graph.

Hope that helps.

Víctor

On Jan 19, 2012, at 01:49 , Carlos Eduardo wrote:

> Hello,
>  
> Commonly I use a sequence of commands like that:
>  
> g$density<-graph.density(g)
> g$diameter<-diameter(g)
> V(g)$ articulation.points <-0
> V(g)[articulation.points(g)]$ articulation.points <-1
>  
> Does anyone know any way to automating this sequence? Something like a script 
> do execute everything at same time in R…
>  
> Thanks in advance,
> Cadu
> _______________________________________________
> 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]