matrix_to_tbl_df: Reformat a matrix int oa tbl_df table

Description Usage Arguments Value See Also Examples

View source: R/formatting.R

Description

Reformat a matrix int oa tbl_df table

Usage

1
matrix_to_tbl_df(a_matrix, row_name, col_name, value_name)

Arguments

a_matrix

a matrix

row_name

name of output column where row names of a_matrix will be stored

col_name

name of output column where column names of a_matrix will be stored

col_name

name of output column where values from a_matrix will be stored

Value

a tbl_df object with columns matching the row names, column names and values of a_matrix

See Also

tbl_df_to_matrix

Examples

1
2
3
4
input_matrix <- matrix(1:9, ncol = 3)
rownames(input_matrix) <- letters[1:3]
colnames(input_matrix) <- LETTERS[1:3]
matrix_to_tbl_df(input_matrix, "row", "col", "val")

shackett/shackettMisc documentation built on May 29, 2019, 8:06 p.m.