mat2seq: matrix to sequence conversion

View source: R/mat2seq.R

mat2seqR Documentation

matrix to sequence conversion

Description

matrix to sequence conversion

Usage

mat2seq(mat)

Arguments

mat

square interaction matrix with winner in rows and losers in columns (can have column/row names or not)

Value

a data.frame with a winner and a loser column

Examples

mat <- matrix(c(0,1,1,0,0,1,0,0,0), ncol=3, byrow = TRUE)
rownames(mat) <- colnames(mat) <- LETTERS[1:3]
mat2seq(mat)

mat <- matrix(c(0,1,1,0,0,1,3,0,0), ncol=3, byrow = TRUE)
rownames(mat) <- colnames(mat) <- LETTERS[1:3]
mat2seq(mat)

# without column names
mat <- matrix(c(0,1,1,0,0,1,0,0,0), ncol=3, byrow = TRUE)
mat2seq(mat)


gobbios/EloRating2 documentation built on June 4, 2023, 2:36 p.m.