perm_label: Permute labels of a matrix

View source: R/utilities.R

perm_labelR Documentation

Permute labels of a matrix

Description

This function permutes the labels of a matrix.

Usage

perm_label(A, m = 1, unique = FALSE)

Arguments

A

A matrix

m

Number of permutations

unique

Whether to return unique cases

Value

This function returns the permutation of labels.

Author(s)

Alejandro Espinosa-Rada

Examples


W <- matrix(c(
  0, 1, 0, 0, 0,
  0, 0, 1, 0, 0,
  1, 0, 0, 0, 0,
  0, 0, 0, 0, 1,
  0, 0, 0, 1, 0
), byrow = TRUE, ncol = 5)
rownames(W) <- c("P", "Q", "R", "S", "T")
colnames(W) <- rownames(W)
perm_label(W, m = 1000, unique = TRUE)


anespinosa/netmem documentation built on April 5, 2025, 5:02 p.m.