Skip to contents

This function identifies cliques of a specified size in a transition network. It searches for cliques—complete subgraphs where every pair of nodes is connected—of size n in the transition matrix for the specified cluster in the tna object.

Usage

cliques(x, ...)

# S3 method for class 'tna'
cliques(x, size = 2, threshold = 0, sum_weights = FALSE, ...)

# S3 method for class 'group_tna'
cliques(x, size = 2, threshold = 0, sum_weights = FALSE, ...)

Arguments

x

A tna or a group_tna object.

...

Ignored.

size

An integer specifying the size of the cliques to identify. Defaults to 2 (dyads).

threshold

A numeric value that sets the minimum edge weight for an edge to be considered in the clique. Edges below this value are ignored. Defaults to 0.

sum_weights

A logical value specifying whether the sum of the weights should be above the threshold instead of individual weights of the directed edges. Defaults to FALSE.

Value

A tna_cliques object which is a list of two elements:

  • weights is a matrix of the edge weights in the clique.

  • inits is a numeric vector of initial weights for the clique.

If x is a group_tna object, a group_tna_cliques object is returned instead, which is a list or tna_cliques objects.

Examples

model <- tna(group_regulation)

# Find  2-cliques (dyads)
cliq <- cliques(model, size = 2)

model <- group_tna(engagement_mmm)
cliques(model)
#> Cluster 1:
#> 
#> Number of 2-cliques: 2 (weight threshold = 0)
#> Showing 2 cliques starting from clique number 1
#> 
#> Clique 1:
#>              Average Disengaged
#> Average    0.4598214 0.02678571
#> Disengaged 0.3809524 0.28571429
#> 
#> Clique 2:
#>            Active   Average
#> Active  0.7061503 0.2938497
#> Average 0.5133929 0.4598214
#> 
#> Cluster 2:
#> 
#> Number of 2-cliques: 3 (weight threshold = 0)
#> Showing 3 cliques starting from clique number 1
#> 
#> Clique 1:
#>              Average Disengaged
#> Average    0.5860735 0.08897485
#> Disengaged 0.5733333 0.09333333
#> 
#> Clique 2:
#>            Active   Average
#> Active  0.4924242 0.4419192
#> Average 0.3249516 0.5860735
#> 
#> Clique 3:
#>               Active Disengaged
#> Active     0.4924242 0.06565657
#> Disengaged 0.3333333 0.09333333
#> 
#> Cluster 3:
#> 
#> Number of 2-cliques: 3 (weight threshold = 0)
#> Showing 3 cliques starting from clique number 1
#> 
#> Clique 1:
#>              Average Disengaged
#> Average    0.5731707  0.2674216
#> Disengaged 0.4707602  0.4634503
#> 
#> Clique 2:
#>            Active   Average
#> Active  0.3006757 0.6081081
#> Average 0.1594077 0.5731707
#> 
#> Clique 3:
#>                Active Disengaged
#> Active     0.30067568 0.09121622
#> Disengaged 0.06578947 0.46345029