mvRowsToLast: Move rows to the last rows of data frame given a column value

Description Usage Arguments Value Examples

Description

Move rows to the last rows of data frame given a column value

Usage

1
mvRowsToLast(data, col, regex = "unclassified", ignore.case = TRUE)

Arguments

data

A data frame.

col

The column, which can be a string (column name) or number (index of the column).

regex

Regular expression for grep to indetify rows. Default to "unclassified". Use "^string$" to perform exact match.

ignore.case

Refer to grep.

Value

The data frame of rows moved to the last.

Examples

1
2
3
4
# move all rows having "unclassified" phyla to the last rows
data <- mvRowsToLast(data, "phylum")
# move all rows having exctly mathced "Bacteria" in column 1 to the last rows
data <- mvRowsToLast(data, 1, regex="^Bacteria$")

walterxie/ComMA documentation built on May 3, 2019, 11:51 p.m.