tbl_df_to_matrix: Reformat a tbl_df table into a matrix

Description Usage Arguments Value See Also Examples

View source: R/formatting.R

Description

Reformat a tbl_df table into a matrix

Usage

1
2
3
tbl_df_to_matrix(a_table, row_name, col_name, value_name)

tbl_df_to_matrix_(a_table, row_name, col_name, value_name)

Arguments

a_table

a tbl_df object with column names row_name, col_name, and value_name

row_name

column of a_table representing rows in the desired matrix

col_name

column of a_table representing columns in the desired matrix

value_name

column of a_table representing values of the matrix

Value

a matrix

See Also

matrix_to_tbl_df

Examples

1
2
3
4
5
6
input_data <- dplyr::data_frame(a = rep(letters[1:3], each = 3),
                                b = rep(LETTERS[1:3], times = 3),
                                c = 1:9, extra_field = 2:10)
tbl_df_to_matrix(input_data, a, b, c)

tbl_df_to_matrix_(input_data, "a", "b", "c")

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