This function permutes the labels of a matrix.
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)
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] "R" "T" "P" "S" "Q"
#> [2,] "R" "P" "S" "Q" "T"
#> [3,] "R" "P" "Q" "T" "S"
#> [4,] "Q" "R" "S" "P" "T"
#> [5,] "P" "S" "R" "Q" "T"
#> [6,] "T" "P" "Q" "S" "R"
#> [7,] "P" "S" "Q" "R" "T"
#> [8,] "R" "T" "Q" "P" "S"
#> [9,] "R" "Q" "S" "P" "T"
#> [10,] "P" "R" "Q" "T" "S"
#> [11,] "Q" "R" "P" "S" "T"
#> [12,] "T" "R" "P" "Q" "S"
#> [13,] "P" "R" "S" "Q" "T"
#> [14,] "T" "Q" "P" "S" "R"
#> [15,] "T" "S" "Q" "P" "R"
#> [16,] "Q" "P" "S" "R" "T"
#> [17,] "S" "T" "P" "R" "Q"
#> [18,] "P" "Q" "R" "S" "T"
#> [19,] "T" "Q" "R" "S" "P"
#> [20,] "S" "R" "T" "P" "Q"
#> [21,] "T" "P" "R" "S" "Q"
#> [22,] "Q" "R" "T" "P" "S"
#> [23,] "S" "R" "P" "Q" "T"
#> [24,] "S" "Q" "P" "R" "T"
#> [25,] "Q" "P" "T" "R" "S"
#> [26,] "P" "R" "T" "S" "Q"
#> [27,] "Q" "S" "R" "T" "P"
#> [28,] "P" "R" "T" "Q" "S"
#> [29,] "P" "T" "S" "Q" "R"
#> [30,] "T" "Q" "R" "P" "S"
#> [31,] "T" "S" "R" "P" "Q"
#> [32,] "T" "R" "Q" "S" "P"
#> [33,] "T" "S" "R" "Q" "P"
#> [34,] "Q" "T" "P" "S" "R"
#> [35,] "S" "T" "Q" "R" "P"
#> [36,] "Q" "R" "T" "S" "P"
#> [37,] "S" "T" "Q" "P" "R"
#> [38,] "T" "P" "S" "Q" "R"
#> [39,] "T" "P" "Q" "R" "S"
#> [40,] "Q" "R" "P" "T" "S"
#> [41,] "Q" "P" "T" "S" "R"
#> [42,] "S" "R" "P" "T" "Q"
#> [43,] "Q" "T" "P" "R" "S"
#> [44,] "S" "R" "Q" "T" "P"
#> [45,] "R" "T" "S" "P" "Q"
#> [46,] "P" "S" "R" "T" "Q"
#> [47,] "R" "S" "P" "T" "Q"
#> [48,] "R" "T" "Q" "S" "P"
#> [49,] "P" "T" "R" "S" "Q"
#> [50,] "R" "Q" "T" "S" "P"
#> [51,] "S" "P" "T" "R" "Q"
#> [52,] "S" "Q" "T" "R" "P"
#> [53,] "T" "P" "S" "R" "Q"
#> [54,] "R" "P" "S" "T" "Q"
#> [55,] "R" "S" "Q" "T" "P"
#> [56,] "R" "S" "T" "P" "Q"
#> [57,] "R" "P" "T" "Q" "S"
#> [58,] "P" "Q" "S" "R" "T"
#> [59,] "P" "T" "R" "Q" "S"
#> [60,] "R" "P" "T" "S" "Q"
#> [61,] "T" "R" "S" "Q" "P"
#> [62,] "S" "R" "T" "Q" "P"
#> [63,] "P" "Q" "T" "S" "R"
#> [64,] "R" "P" "Q" "S" "T"
#> [65,] "Q" "S" "T" "R" "P"
#> [66,] "Q" "T" "S" "R" "P"
#> [67,] "T" "P" "R" "Q" "S"
#> [68,] "Q" "T" "R" "S" "P"
#> [69,] "R" "T" "S" "Q" "P"
#> [70,] "Q" "R" "S" "T" "P"
#> [71,] "T" "S" "P" "Q" "R"
#> [72,] "R" "Q" "T" "P" "S"
#> [73,] "T" "S" "Q" "R" "P"
#> [74,] "S" "Q" "T" "P" "R"
#> [75,] "S" "Q" "R" "T" "P"
#> [76,] "P" "T" "Q" "S" "R"
#> [77,] "T" "S" "P" "R" "Q"
#> [78,] "P" "S" "Q" "T" "R"
#> [79,] "R" "Q" "S" "T" "P"
#> [80,] "P" "Q" "S" "T" "R"
#> [81,] "P" "R" "S" "T" "Q"
#> [82,] "R" "S" "T" "Q" "P"
#> [83,] "P" "S" "T" "Q" "R"
#> [84,] "R" "T" "P" "Q" "S"
#> [85,] "Q" "P" "S" "T" "R"
#> [86,] "T" "R" "Q" "P" "S"
#> [87,] "S" "P" "R" "T" "Q"
#> [88,] "P" "R" "Q" "S" "T"
#> [89,] "P" "T" "Q" "R" "S"
#> [90,] "S" "Q" "P" "T" "R"
#> [91,] "S" "T" "R" "P" "Q"
#> [92,] "Q" "S" "T" "P" "R"
#> [93,] "T" "R" "S" "P" "Q"
#> [94,] "Q" "S" "R" "P" "T"
#> [95,] "Q" "P" "R" "T" "S"
#> [96,] "Q" "S" "P" "T" "R"
#> [97,] "T" "Q" "S" "P" "R"
#> [98,] "R" "S" "Q" "P" "T"
#> [99,] "R" "S" "P" "Q" "T"
#> [100,] "P" "Q" "T" "R" "S"
#> [101,] "Q" "T" "R" "P" "S"
#> [102,] "P" "Q" "R" "T" "S"
#> [103,] "S" "P" "R" "Q" "T"
#> [104,] "P" "S" "T" "R" "Q"
#> [105,] "S" "P" "Q" "T" "R"
#> [106,] "Q" "S" "P" "R" "T"
#> [107,] "R" "Q" "P" "S" "T"
#> [108,] "Q" "P" "R" "S" "T"
#> [109,] "P" "T" "S" "R" "Q"
#> [110,] "S" "Q" "R" "P" "T"
#> [111,] "S" "P" "Q" "R" "T"
#> [112,] "R" "Q" "P" "T" "S"
#> [113,] "S" "P" "T" "Q" "R"
#> [114,] "T" "R" "P" "S" "Q"
#> [115,] "S" "T" "P" "Q" "R"
#> [116,] "S" "T" "R" "Q" "P"
#> [117,] "T" "Q" "S" "R" "P"
#> [118,] "Q" "T" "S" "P" "R"
#> [119,] "S" "R" "Q" "P" "T"
#> [120,] "T" "Q" "P" "R" "S"