as_mcml: Convert to mcml

View source: R/cluster-metrics.R

as_mcmlR Documentation

Convert to mcml

Description

Converts an object to the mcml class, a representation of a multi-cluster network that does not depend on the tna package.

Usage

as_mcml(x, ...)

## S3 method for class 'cluster_summary'
as_mcml(x, ...)

## S3 method for class 'group_tna'
as_mcml(x, clusters = NULL, method = "sum", type = "tna", directed = TRUE, ...)

## S3 method for class 'mcml'
as_mcml(x, ...)

## Default S3 method:
as_mcml(x, ...)

Arguments

x

A cluster_summary, group_tna or mcml object. Any other input is an error; summarize_clusters builds an mcml object from raw data.

...

Additional arguments passed to methods.

clusters

Integer or character vector of row-to-group assignments. Required when the group_tna has the same labels across all groups (row-level clustering from tna::group_model(cluster_data(...))).

method

Aggregation method for macro weights (default "sum").

type

Transition type (default "tna").

directed

Logical; whether the network is directed (default TRUE).

Value

An mcml object with components macro, clusters, cluster_members, and meta.

An mcml object.

An mcml object. When clusters is provided, macro$data contains the cluster assignments and macro$weights is NULL.

The input mcml object unchanged.

See Also

summarize_clusters, as_tna

Examples

clusters <- list(C1 = c("Explore", "Reflect", "Discuss"),
                 C2 = c("Plan", "Create", "Share"),
                 C3 = c("Monitor", "Adapt", "Synthesize", "Evaluate"))
as_mcml(csum(regulation_net, clusters = clusters, type = "tna"))

cograph documentation built on Nov. 19, 2026, 5:07 p.m.