find_partition_rcpp: Refer to the R function find_partition() For notes of the...

View source: R/RcppExports.R

find_partition_rcppR Documentation

Refer to the R function find_partition() For notes of the graph object, refer to https://igraph.org/c/doc/igraph-Basic.html

Description

Refer to the R function find_partition() For notes of the graph object, refer to https://igraph.org/c/doc/igraph-Basic.html

Usage

find_partition_rcpp(
  edgelist,
  edgelist_length,
  num_vertices,
  direction,
  edge_weights,
  resolution = 1,
  niter = 2L
)

Arguments

edgelist

The graph edge list

edgelist_length

integer The length of the graph edge list

num_vertices

integer The number of vertices in the graph

direction

boolean Whether the graph is directed or undirected

edge_weights

Vector of edge weights. In weighted graphs, a real number is assigned to each (directed or undirected) edge. For an unweighted graph, this is set to 1. Refer to igraph, weighted graphs.

resolution

Numeric scalar, resoluiton parameter controlling communities detected (default=1.0) Higher resolutions lead to more communities, while lower resolutions lead to fewer communities.

niter

Number of iterations that the algorithm should be run for (default=2)

Value

A vector of membership values

Examples

library(igraph)
edgelist <- as.vector(t(igraph::as_edgelist(exampleGraph, names=FALSE))) - 1
edgelist_length <- length(edgelist)
num_vertices <- length(igraph::V(exampleGraph)) - 1
direction <- igraph::is_weighted(exampleGraph)
find_partition_rcpp(edgelist, edgelist_length, num_vertices, direction, E(exampleGraph)$weight)

leidenAlg documentation built on Sept. 8, 2023, 5:42 p.m.