as_matrix-methods: Get matrix from tibble

Description Usage Arguments Value Examples

Description

Get matrix from tibble

as_matrix

as_matrix

Usage

1
2
3
4
5
6
7
as_matrix(.data, rownames = NULL, do_check = TRUE, sep_rownames = "___")

## S4 method for signature 'spec_tbl_df'
as_matrix(.data, rownames = NULL, do_check = TRUE, sep_rownames = "___")

## S4 method for signature 'tbl_df'
as_matrix(.data, rownames = NULL, do_check = TRUE, sep_rownames = "___")

Arguments

.data

A tibble

rownames

A character string of the rownames

do_check

A boolean

sep_rownames

A character with which multiple columns are united if rownames is a column array (e.g., rownames = c(col1, col2))

Value

A matrix

A 'tbl' with filled abundance

A 'tbl' with filled abundance

Examples

1
2
3
4
5
6
 library(dplyr)
 library(tidyr)
 select(mtcars_tidy, car_model, feature, value) %>%
	spread(feature, value) %>%
	as_matrix(rownames = car_model) 
	

nanny documentation built on July 1, 2020, 10:20 p.m.