arrange {matrixset}R Documentation

Re-order rows or columns of a matrixset

Description

Orders the rows (arrange_row()) or columns (arrange_column()) by annotation values.

The mechanic is based on sorting the annotation data frame via dplyr's dplyr::arrange().

This means, for instance, that grouping is ignored by default. You must either specify the grouping annotation in the sorting annotation, or use .by_group = TRUE.

The handling of locales and handling of missing values is also governed by dplyr's arrange().

Usage

arrange_row(.ms, ..., .by_group = FALSE)

arrange_column(.ms, ..., .by_group = FALSE)

Arguments

.ms

A matrixset object

...

Name of traits to base sorting upon. Tidy selection is supported. Use dplyr::desc() to sort an annotation in descending order.

.by_group

logical. Defaults to FALSE and even if TRUE, has no impact on ungrouped margin. Otherwise, grouping annotation is used first for sorting.

Value

A matrixset with re-ordered rows or columns, including updated row or column meta info.

Examples

ms1 <- remove_row_annotation(student_results, class, teacher)

# this would not work
# remove_row_annotation(row_group_by(student_results, class), class)

[Package matrixset version 0.3.0 Index]