apply_subgraphs: Applies function to each subgraph of a graph

View source: R/scoring_functions.R

apply_subgraphsR Documentation

Applies function to each subgraph of a graph

Description

Applies function to each subgraph of a graph

Usage

apply_subgraphs(g, com, f, ...)

Arguments

g

igraph graph

com

vector of memberships that determines the subgraphs (i.e. all elements with the same label will form a subgraph).

f

Function to apply. Takes a graph as input and returns a scalar.

Value

vector with the result of each subgraph

Examples

data(karate, package="igraphdata")
apply_subgraphs(g=karate, com=V(karate)$Faction, f=gorder)

clustAnalytics documentation built on May 29, 2024, 12:18 p.m.