select_if: Select rows/columns of a matrix using a predicate

Description Usage Arguments Value

Description

Select rows/columns of a matrix using a predicate

Usage

1
select_if(predicate, mat, margin, ...)

Arguments

predicate

A function taking a row/column as first argument and returning TRUE or FALSE

mat

Matrix

margin

Whether to select rows or columns (1 = rows, 2 = columns).

...

Passed on to predicate

Value

If margin is 1, a matrix with the same number of columns as mat and including all rows of mat for which predicate returned TRUE. If margin is 2, a matrix with the same number of rows as mat and including all columns of mat for which predicate returned TRUE.


cbhelmholtz/metaboliteqc documentation built on May 13, 2019, 2:03 p.m.