mat2df: Transform matrix to data.frame.

Description Usage Arguments Value Author(s) Examples

Description

Transform a matrix into a data.frame where each row corresponds to a single matrix entry.

Usage

1
mat2df(mat)

Arguments

mat

The matrix to be transformed.

Value

A data.frame where one row corresponds to one matrix entry. If the matrix has row or column names, these will be included.

Author(s)

Dominik Mueller

Examples

1
2
3
4
5
6
7
8
mat <- matrix(1:12, nrow = 3)
mat2df(mat)
rownames(mat) <- 1:3 
mat2df(mat)
colnames(mat) <- letters[1:4]
mat2df(mat)
rownames(mat) <- NULL
mat2df(mat)

DominikMueller64/dmisc documentation built on May 6, 2019, 2:52 p.m.