matrix_long: Convert a matrix to long form for ggplotting

Description Usage Arguments Value Examples

View source: R/util.R

Description

A convenience function which melts the matrix and then joins row and column information.

Usage

1
2
3
4
5
6
matrix_long(
  matrix,
  row_info = NULL,
  col_info = NULL,
  varnames = c("name", "col")
)

Arguments

matrix

A matrix, or object that can be converted to a matrix.

row_info

Information about rows of the matrix. A data frame, or object that can be converted to a data frame.

col_info

Information about columns of the matrix. A data frame, or object that can be converted to a data frame.

varnames

Vector of two column names in the output, the first for the row and the second for the column.

Value

A data frame containing the matrix and associated information in long format.

Examples

1
matrix_long(weitrix_x(simwei), rowData(simwei), colData(simwei))

weitrix documentation built on Nov. 8, 2020, 8:10 p.m.