Filippo Santi
2018-01-23 18:29:46 UTC
Dear all,
I am new to R and even more to igraph. I am working on foreign direct
investment network, and I am currently trying to compute average nearest
neighbour degree and average nearest neighbour strength, using the knn
function. My code is as following:
fdi.graph.2003 <- graph_from_data_frame(fdi.edge.2003, directed = T,
vertices = fdi.attr.2003)
ANND <- knn(fdi.graph.2003)
However, R returns the following error message
Error in knn(fdi.graph.2003) :
At structural_properties.c:5889 : Average nearest neighbor degree Works
only with simple graphs, Invalid value
Do you have any explanation to try to solve this issue? I tried to compute
it building the graph from a simple binary edgelist too (the above message
comes from computations based on a weighted network with plenty of edge
attributes, built from a data.frame) but it is not working either.
Thanks for any help,
Filippo
I am new to R and even more to igraph. I am working on foreign direct
investment network, and I am currently trying to compute average nearest
neighbour degree and average nearest neighbour strength, using the knn
function. My code is as following:
fdi.graph.2003 <- graph_from_data_frame(fdi.edge.2003, directed = T,
vertices = fdi.attr.2003)
ANND <- knn(fdi.graph.2003)
However, R returns the following error message
Error in knn(fdi.graph.2003) :
At structural_properties.c:5889 : Average nearest neighbor degree Works
only with simple graphs, Invalid value
Do you have any explanation to try to solve this issue? I tried to compute
it building the graph from a simple binary edgelist too (the above message
comes from computations based on a weighted network with plenty of edge
attributes, built from a data.frame) but it is not working either.
Thanks for any help,
Filippo