Skip to contents

as_cohesion_matrix() converts an existing matrix into an object of class cohesion_matrix.

Usage

as_cohesion_matrix(c)

Arguments

c

A matrix of cohesion values (see cohesion_matrix).

Value

Object of class cohesion_matrix

Examples

C <- matrix(
  c(0.25, 0.125, 0.125, 0,
   0.125, 0.25, 0, 0.125,
   0.125, 0, 0.25, 0.125,
   0, 0.125, 0.125, 0.25
), nrow = 4, byrow = TRUE)

class(C)
#> [1] "matrix" "array" 

C <- as_cohesion_matrix(C)
class(C)
#> [1] "cohesion_matrix" "matrix"          "array"