# Other Functions

library(clustAnalytics)

### reduced_mutual_information

The package includes an implementation of Newman’s Reduced Mutual Information (RMI) , a version of the mutual information that is corrected for chance.

data(karate, package="igraphdata")
c1 <- membership(cluster_louvain(karate))

### apply_subgraphs

The apply_subgraphs function is used internally in the package, but has also been made available to the user because it can be very convenient when working with clusters. It simply calls a function f on each of the communities of a graph (treated as it’s own igraph object), acting as a wrapper for the vapply function. The communities are given as a membership vector com.

For a very simple example, we call it to obtain the order of each of the factions of the karate club graph:

data(karate, package="igraphdata")
apply_subgraphs(g=karate, com=V(karate)\$Faction, f=gorder)
#> [1] 16 18