selectRows: selectRows: Row Selection of A Data.Frame

Description Usage Arguments Details Value Author(s)

View source: R/selectRows.R

Description

selectRows returns row indices of a data.frame matching column-value criteria

Usage

1
selectRows(meta, criteria, rownames = TRUE, not = c(), reorder = FALSE)

Arguments

meta

a data.frame from which to select rows

criteria

a list of named vectors, where the names correspond to columns of meta, and the elements are values of those columns to include. NA is a permissible value. Logically, the values within each element of criteria act as an OR; values between elements are treated as an AND.

rownames

logical; if TRUE, rownames are returned rather than numeric indices

not

character vector specifying names of criteria where only rows of meta that do NOT include the elements specified in the criteria list

reorder

logical; if TRUE, reorder the row indices by the values of the columns specified by criteria, applied in order

Details

The criteria are applied in order, so this will run faster if the most exclusive criteria are applied first. However, the reorder option orders the indices according to the order of the criteria annotations

Value

Returns a vector of numeric row indices (rownames==FALSE) or character rownames of meta that matched the criteria specified

Author(s)

M.W.Rowe, mwr.stats@gmail.com


mwrowe/microRutils documentation built on June 12, 2021, 2:41 p.m.