Learn R Programming

asremlPlus (version 2.0-2)

permute.square: Permutes the rows and columns of a square matrix.

Description

Permutes the rows and columns of a square matrix.

Usage

permute.square(x, permutation)

Arguments

x
A square matrix.
permutation
A vector specifying the new order of rows and columns.

Value

  • A square matrix.

See Also

permute.to.zero.lowertri

Examples

Run this code
terms.marginality <-  matrix(c(1,0,0,0,0,  0,1,0,0,0, 0,1,1,0,0, 
                                 1,1,1,1,0, 1,1,1,1,1), nrow=5)
  permtn <- c(1,3,2,4,5)
  terms.marginality <- permute.square(terms.marginality, permtn)

Run the code above in your browser using DataLab