Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7699931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:35:38+00:00 2026-05-31T22:35:38+00:00

I’m using the Walktrap community detection method to return a number (19 in this

  • 0

I’m using the Walktrap community detection method to return a number (19 in this case) of clusters. I have a list of members which belong to one or more of these clusters.

  1. I need a method to search each cluster for the presence of the
    members and return the percentage of matches found. ( e.g cluster[0]
    = 0%, cluster[1] =Y%…..cluster[18]=Z%) Thus selecting the optimum cluster that represents the members on the list.

  2. Once the optimum cluster is found, I need a method to count the
    number of members of the optimum cluster and from the original
    (19-1) clusters select another cluster that is nearest in size
    (number of members)

     library(igraph)
     edges <- read.csv('http://dl.dropbox.com/u/23776534/Facebook%20%5BEdges%5D.csv')
     list<-read.csv("http://dl.dropbox.com/u/23776534/knownlist.csv")
     all<-graph.data.frame(edges)
     summary(all)
    all_wt<- walktrap.community(all, steps=6,modularity=TRUE,labels=TRUE)
    all_wt_memb <- community.to.membership(all,all_wt$merges,steps=which.max(all_wt$modularity)-1)
    all_wt_memb$csize
    
    >[1] 176  13 204  24   9 263  16   2   8   4  12   8   9  19  15   3   6   2   1
    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:35:39+00:00Added an answer on May 31, 2026 at 10:35 pm

    The %in% function, when used like: a %in% b will determine which of the elements in vector a are also present in vector b. So for each cluster, I would

    • Extract the members of that cluster
    • Given a list of members in which you’re interested, calculate which ones are %in% this cluster — which will return a Boolean vector
    • You can use sum() on the Boolean vector to count the number of true elements (i.e. the number of elements in your initial vector which are present in this cluster
    • (Optionally) you can normalize by the length of the cluster to get the percentage of this cluster which is made up of your list of interest, or by the length of the list you made, to indicate the number of members in your list which are present in this cluster.

    You can loop through each cluster using for() or an apply variant.

    Then given all_wt_memb$csize, you’ll have a given value which is your target, and you’ll want to find the nearest number. See this link, but you’re just calculating the minimum absolute difference:

    x=c(1:100)
    your.number=5.43
    which(abs(x-your.number)==min(abs(x-your.number)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.