reorder_frame: Reorder the rows of a frame.

Description Usage Arguments Value Examples

View source: R/slanter.R

Description

You'd expect data[order,] to "just work". It doesn't for data frames with a single column, which happens for annotation data, hence the need for this function. Sigh.

Usage

1

Arguments

frame

A data frame to reorder the rows of.

order

An array containing indices permutation to apply to the rows.

Value

The data frame with the new row orders.

Examples

1
2
3
df <- data.frame(foo=c(1, 2, 3))
df[c(1,3,2),]
slanter::reorder_frame(df, c(1,3,2))

slanter documentation built on May 9, 2021, 9:07 a.m.