igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Number of isolated nodes in the network


From: jordi torrents
Subject: Re: [igraph] Number of isolated nodes in the network
Date: Thu, 5 Aug 2010 16:56:45 +0200

Hi Claudia,

2010/8/5 Claudia Muller-Birn:
> Dear all,
>
> I might have a fairly simple question but I have difficulties to solve my 
> problem this time.
> I'd like to compute the number of isolates nodes in a network. [...]

The function below gives you a vector with the ids of nodes with
degree 0 (ie isolates):

isolates <- function(g){
  return(which(degree(g)==0)-1)
}

i <- isolates(g)
length(i)

Hope this helps.
Salut!



reply via email to

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