Convert a matrix to a data.frame for plotting

mat_to_data_df(mat, cols_are = "gene_names")

Arguments

mat

a matrix or sparse matrix dgCMatrix object from the Matrix package.

cols_are

whether columns are "gene_names" or "sample_names"

Value

dataframe

Examples

mat_to_data_df(matrix, cols_are = "gene_names")
#> Error in as.vector(x, mode): cannot coerce type 'closure' to vector of type 'any'
mat_to_data_df(matrix, cols_are = "sample_names")
#> Error in t.default(mat): argument is not a matrix