Skip to content

Commit

Permalink
fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
evanbiederstedt committed Mar 3, 2021
1 parent d5d9211 commit 8489fc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/communities.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ NULL
leiden.community <- function(graph, resolution=1.0, n.iterations=2) {

## add check for unweighted graph, i.e. graph$weight is NULL
if (igraph::is_weighted(graph)){
if (!igraph::is_weighted(graph)){
## simply set the vector of edge weights to 1
igraph::E(gr)$weight = 1
igraph::E(graph)$weight = 1
}

x <- find_partition(graph, igraph::E(graph)$weight, resolution, n.iterations)
Expand Down

0 comments on commit 8489fc5

Please sign in to comment.