ms_to_df {matrixset} | R Documentation |
Convert matrixset to data frame
Description
Converts a matrixset
to a data.frame
(a tibble
, more specifically), in
a long format.
When as_list
is TRUE
, each matrix is converted separately. Row/column
annotation is included if requested.
Usage
ms_to_df(
.ms,
add_row_info = TRUE,
add_column_info = TRUE,
as_list = FALSE,
.matrix = NULL
)
Arguments
.ms |
|
add_row_info |
|
add_column_info |
|
as_list |
|
.matrix |
matrix indices of which matrix to include in the
conversion. The default, If not Numeric values are coerced to integer as by Character vectors will be matched to the matrix names of the object. Can also be logical vectors, indicating elements/slices to replace. Such
vectors are NOT recycled, which is an important difference with usual
matrix replacement. It means that the Can also be negative integers, indicating elements/slices to leave out of the replacement. |
Value
A tibble, or if as_list
is TRUE
, A list
of data frames, an element per
converted matrix
Examples
# includes both annotation
ms_to_df(student_results)
# includes only row annotation
ms_to_df(student_results, add_column_info = FALSE)