[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] key players in networks
From: |
Gabor Csardi |
Subject: |
Re: [igraph] key players in networks |
Date: |
Thu, 20 Sep 2007 15:35:10 +0200 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Wed, Sep 19, 2007 at 08:13:14PM +0200, Tamas Nepusz wrote:
> Dear Simone,
>
> > Is there a function like isolates() that retrive a list of isolates
> > nodes so that I can pass it to delete.vertices()?
> No, there is no isolates(), but it is easy to achieve using degree():
>
> isolates <- seq(vcount(g))[degree(g) == 0]
>
> This gives you the indices of the isolated vertices. At least I hope
> so, I'm not an expert in R :)
Should be good. The only catch is that vertex ids start with zero in
igraph, so you need to subtract one. Also, the 'which' function is easier
to use:
which(degree(g)==0)-1
Deleting them is easy of course:
g2 <- delete.vertices(g, which(degree(g)==0)-1)
G.
> --
> Tamas
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
--
Csardi Gabor <address@hidden> MTA RMKI, ELTE TTK
- [igraph] key players in networks, Simone Gabbriellini, 2007/09/11
- Re: [igraph] key players in networks, Gabor Csardi, 2007/09/13
- Re: [igraph] key players in networks, Gabor Csardi, 2007/09/13
- Re: [igraph] key players in networks, Simone Gabbriellini, 2007/09/16
- Re: [igraph] key players in networks, Simone Gabbriellini, 2007/09/19
- Re: [igraph] key players in networks, Tamas Nepusz, 2007/09/19
- Re: [igraph] key players in networks,
Gabor Csardi <=
- [igraph] as.undirected() strips vertex attributes?, uxzmdlj02, 2007/09/21
- Re: [igraph] as.undirected() strips vertex attributes?, Tamas Nepusz, 2007/09/21
- Re: [igraph] as.undirected() strips vertex attributes?, uxzmdlj02, 2007/09/21
- Re: [igraph] as.undirected() strips vertex attributes?, Gabor Csardi, 2007/09/24
- Re: [igraph] as.undirected() strips vertex attributes?, Tamas Nepusz, 2007/09/24