matrix_to_tibble: Convert matrix to tibble.

Description Usage Arguments Examples

View source: R/matrix_to_tibble.R

Description

Convert matrix to tibble.

Usage

1
matrix_to_tibble(.mat, .row = FALSE, .rowname = NULL)

Arguments

.mat

matrix

.row

logical, convert rowname to column?

.rowname

character, rowname.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
mat <-
   matrix(data = rnorm(100),
          nrow = 10,
          ncol = 10)

rownames(mat) <- sprintf("com_%d", 1:10)

# convert to tibble.
matrix_to_tibble(.mat = mat, .row = FALSE)
# move rownames to column.
matrix_to_tibble(.mat = mat, .row = TRUE, .rowname = "com")

Hide-Fun/teco documentation built on July 28, 2021, 7:41 a.m.