igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Can I subset a "communities" object based on communities si


From: Gábor Csárdi
Subject: Re: [igraph] Can I subset a "communities" object based on communities sizes?
Date: Sun, 24 Nov 2013 16:52:17 -0500

I am missing something. So you want to remove vertices from the
community graph, or from the original graph?

G.

On Sun, Nov 24, 2013 at 4:48 PM,  <address@hidden> wrote:
> But if I contract the graph how would I then find the vertices belonging to
> small communities to remove them?
>
> Il 24.11.2013 21:42 Gábor Csárdi ha scritto:
>
>> How about contracting the graph first, and then removing the vertices
>> that belong to the small communities after?
>>
>> G.
>>
>> On Sun, Nov 24, 2013 at 4:34 PM,  <address@hidden> wrote:
>>>
>>> I have an object "communities" with few large communities and many
>>> communities with just few members. I would like to create a community
>>> graph
>>> to plot (with one node for each community) but excluding communities with
>>> less than 20 members.
>>>
>>> I was able to subset the graph based on membership to largest communities
>>> with
>>>
>>>     ids <- which(sizes(communities)>20)
>>>     subgraph <- induced.subgraph(graph, which(membership(communities)
>>> %in%
>>> id))
>>>
>>> Now I wanted to apply this (from
>>> http://stackoverflow.com/a/12699979/1707938) to my case
>>>
>>>    contractgraph <- contract.vertices(subgraph, membership(communities))
>>>    E(contractgraph)$weight <- 1
>>>    contractgraph2 <- simplify(contractgraph, remove.loops=FALSE)
>>>
>>> But of course I have a problem because "subgraph" and "communities" have
>>> different length. How could I proceed? Should I try to subset
>>> "communities"
>>> based on sizes(communities)>20?
>>>
>>> _______________________________________________
>>> 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
>
>
> _______________________________________________
> 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]