matrix_long: Convert a matrix to long form for ggplotting

View source: R/util.R

matrix_longR Documentation

Convert a matrix to long form for ggplotting

Description

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

Usage

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

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


pfh/weitrix documentation built on Oct. 13, 2023, 1:01 p.m.