[R] igraph -- Selecting closest neighbors

Michael Haenlein haenlein at escpeurope.eu
Sat Oct 17 14:07:05 CEST 2015


Dear all,

I am looking for a function to select the N closest neighbors (in terms of
distance) of a vertex in igraph.

Assume for example N=7. If the vertex has 3 direct neighbors, I would like
that the function selects those 3 plus a random 4 among the second degree
neighbors.

Is there some way to do this in an efficient way? I have been trying to
program something using ego () with varying levels of distance but I have
not managed to get a conclusive solution.

Thanks for your help,

Michael


Michael Haenlein
Professor of Marketing
ESCP Europe

	[[alternative HTML version deleted]]



More information about the R-help mailing list