Cluster your Facebook friends

January 22, 2012

(This article was first published on, and kindly contributed to R-bloggers)

Last week, I came across two interesting posts by Romain François and Petr Simecek:

As coincidence would have it, I also came across an older introductory post about social network analysis (Grey’s Anatomy Network of Sexual Relations) which could actually complement quite well the two posts above.

Using the igraph package, it is very easy to use the Girvan-Newman algorithm to automatically detect your groups/clusters of friends. The code below show how to display the names of your friends on the plot.


Here is the full code to create the chart above:

Comments are closed.

Recent popular posts

Most visited articles of the week

  1. How to write the first for loop in R
  2. Installing R packages
  3. How to perform a Logistic Regression in R
  4. Using apply, sapply, lapply in R
  5. How to Make a Histogram with Basic R
  6. Tutorials for learning R
  7. Simple Linear Regression
  8. timekit: Time Series Forecast Applications Using Data Mining
  9. Technical Foundations of Informatics: A modern introduction to R


RSS Jobs for R users

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)