[Top][All Lists]

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

[igraph] Using external software for community detection in R

From: Fabio Daolio
Subject: [igraph] Using external software for community detection in R
Date: Wed, 20 Oct 2010 20:05:24 +0200

First of all, thanks again for the great work on the library.

I'd like to share with you what I'm doing: possibly there's a
better way to do it, maybe this could be useful to somebody
I need to use the MCL algorithm, and I'd also like to try the
InfoMap algorithm in the near future, using the R interface.

Let's say that my network is stored in the variable "df", that
I'd like to pass it to MCL as a list of weighed edge, and that,
finally, I'd like to assign a membership value to its vertices
as a result of the community detection.

Here's what I came up with:

cmd<-paste("mcl - --abc -o - >",outfile,sep="")

pr<-pipe(paste("cat ",outfile,sep=""),open="r")
comms<-strsplit(split="\t", lines)

for(i in 1:length(comms)){
        for(n in comms[[i]]){


Basically I set up a pipe for writing the network to MCL,
whose output is redirected to a temporary file, from which
I read through another pipe. It works.

Is there a way to avoid even the creation of that tmp file?
And is there a quicker way to assign memberships?
Fabio Daolio

PhD Student
Research & Teaching Assistant

UNIL    University of Lausanne
HEC     École des Hautes Études Commerciales
ISI             Institut des Systèmes d'Information

Quartier UNIL-Dorigny,  Internef 135
CH-1015 Lausanne,  Switzerland

Phone:  +41 (0)21 692 35 83
Fax:            +41 (0)21 692 35 85
Skype:  fabiodaolio

reply via email to

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