matrix_long {weitrix} | R 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))

[Package weitrix version 1.0.0 Index]