tibble_to_matrix: Convert tibble to matrix.

Description Usage Arguments Examples

View source: R/tibble_to_matrix.R

Description

Convert tibble to matrix.

Usage

1
tibble_to_matrix(.tbl, .row = FALSE, .rowname = NULL)

Arguments

.tbl

tibble

.row

logical, Want rownames?

.rowname

character, names of rownames column.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(tibble)

tbl <-
   tibble(com = sprintf("com_%d", 1:10),
          V1 = rnorm(10),
          V2 = rnorm(10))

# convert to matrix.
tibble_to_matrix(.tbl = tbl, .row = FALSE)
# move rownames to column.
tibble_to_matrix(.tbl = tbl, .row = TRUE, .rowname = "com")

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