df2matrix: Convert data.frame and tibbles to matrices with named rows...

View source: R/main.R

df2matrixR Documentation

Convert data.frame and tibbles to matrices with named rows and columns

Description

Convert data.frame and tibbles to matrices with named rows and columns

Usage

df2matrix(d, first_col_is_row_names = TRUE)

Arguments

d

data.frame or tibble

first_col_is_row_names

TRUE if first column has row names

Value

matrix

Examples


d <- data.frame(rname = c("x1", "x2"), x1 = c(1,2), x2 = c(3,4))
df2matrix(d)

wjschne/WJSmisc documentation built on June 29, 2023, 8:04 a.m.