Hi,

I want to implement community detection in R. I used the following functions and got these errors:

```
d1<-cluster_edge_betweenness(g2,directed='TRUE')
Error in cluster_edge_betweenness(g2, directed = "TRUE") :
At community.c:455 : weights must be strictly positive, Invalid value
```

```
d1<-cluster_leading_eigen(g2)
Modularity is implemented for undirected graphs only.
Error in cluster_leading_eigen(g2) :
At community.c:933 : negative weight in weight vector, Invalid value
Warning message:
In cluster_leading_eigen(g2) :
At community.c:1597 :This method was developed for undirected graphs
```

```
d1<-cluster_infomap(g2)
Modularity is implemented for undirected graphs only.
Error in modularity.igraph(graph, res$membership, weights = e.weights) :
At community.c:933 : negative weight in weight vector, Invalid value
```

Does anyone know how I can solve it?

I also tried to compute modularity in python, but but it says that ‘Modularity is implemented for undirected graphs only.’

Thank you