detriangularisation: Ordering matrix columns and rows

Description Usage Arguments Value Examples

Description

Assume the names of the matrix are : "N3","N4","N2","N1". This function will order the matrix rows and columns so the names are in the order : "N1","N2","N3","N4".

Usage

1

Arguments

mat

matrix - rownames and colnames must be of the form "N#" where # is an integer. It's a square matrix.

Value

The initial matrix ordered in a new way.

Examples

1
2
3
4
5
6
W <- matrix(0,4,4)
W[1,2] = 1
W[2,3] = 1
W[3,4] = 1
colnames(W) = rownames(W) = c("N3","N4","N1","N2")
detriangularisation(W)

andreamrau/GBNcausal documentation built on May 12, 2019, 3:34 a.m.