robinCompare: robinCompare

View source: R/ROBIN_external_function.R

robinCompareR Documentation

robinCompare

Description

This function compares the robustness of two community detection algorithms.

Usage

robinCompare(
  graph,
  method1 = c("walktrap", "edgeBetweenness", "fastGreedy", "leadingEigen", "louvain",
    "spinglass", "labelProp", "infomap", "optimal", "leiden", "other"),
  args1 = list(),
  method2 = c("walktrap", "edgeBetweenness", "fastGreedy", "leadingEigen", "louvain",
    "spinglass", "labelProp", "infomap", "optimal", "leiden", "other"),
  args2 = list(),
  FUN1 = NULL,
  FUN2 = NULL,
  measure = c("vi", "nmi", "split.join", "adjusted.rand"),
  type = NULL,
  verbose = TRUE,
  dist = "Other",
  BPPARAM = BiocParallel::bpparam()
)

Arguments

graph

The output of prepGraph.

method1

The first clustering method, one of "walktrap", "edgeBetweenness", "fastGreedy", "louvain", "spinglass", "leadingEigen", "labelProp", "infomap","leiden","optimal","other".

args1

A list of arguments to be passed to the method1 (see i.e. cluster_leiden for a list of possible method parameters).

method2

The second custering method one of "walktrap", "edgeBetweenness","fastGreedy", "louvain", "spinglass", "leadingEigen", "labelProp", "infomap","leiden","optimal","other".

args2

A list of arguments to be passed to the method2 (see i.e. cluster_leiden for a list of possible method parameters).

FUN1

personal designed function when method1 is "other". see methodCommunity.

FUN2

personal designed function when method2 is "other". see methodCommunity.

measure

The stability measure, one of "vi", "nmi", "split.join", "adjusted.rand" all normalized and used as distances. "nmi" refers to 1- nmi and "adjusted.ran" refers to 1-adjusted.rand.

type

Character indicating "independent" or "dependent" for the old robin type contruction. If NULL the new faster version is computed (default NULL).

verbose

flag for verbose output (default as TRUE).

dist

Option to rewire in a manner that retains overall graph weight regardless of distribution of edge weights. This option is invoked by putting any text into this field. Defaults to "Other". See rewireR for details.

BPPARAM

the BiocParallel object of class bpparamClass that specifies the back-end to be used for computations. See bpparam for details.

Value

A list object with two matrices: - the matrix "Mean1" with the means of the procedure for the first method - the matrix "Mean2" with the means of the procedure for the second method

Examples

my_file <- system.file("example/football.gml", package="robin")
graph <- prepGraph(file=my_file, file.format="gml")
robinCompare(graph=graph, method1="louvain", args1 = list(resolution=0.8),
            method2="leiden", args2=list(objective_function ="modularity"))

robin documentation built on June 24, 2024, 5:11 p.m.