A <- matrix(c(
0, 1, 1, 0, 0,
1, 0, 1, 0, 0,
1, 1, 0, 0, 0,
0, 0, 0, 0, 1,
0, 0, 0, 1, 0
), byrow = TRUE, ncol = 5)
rownames(A) <- letters[1:ncol(A)]
colnames(A) <- rownames(A)
components_id(A)
#> $components
#> [1] 1 1 1 2 2
#>
#> $size
#> components
#> 1 2
#> 3 2
#>