mat2long: Expand matrix to data.frame via row and column names

View source: R/mat2long.R

mat2longR Documentation

Expand matrix to data.frame via row and column names

Description

Expand matrix to data.frame via row and column names

Usage

mat2long(x)

Arguments

x

a matrix with row and column names

Value

a data.frame with row names in the Rx column, and the column names in the Cx column, and values in the val column

Examples

x <- matrix(1:20, ncol=4)
rownames(x) <- paste0("r", 1:5)
colnames(x) <- paste0("c", 1:4)
mat2long(x)

gobbios/cfp documentation built on April 11, 2022, 2:22 a.m.