coordOfFilt: Get Coordinates Of Values/Points In Matrix According To...

View source: R/coordOfFilt.R

coordOfFiltR Documentation

Get Coordinates Of Values/Points In Matrix According To Filtering Condition

Description

Get coordinates of values/points in matrix according to filtering condition

Usage

coordOfFilt(
  mat,
  cond,
  sortByRows = FALSE,
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Arguments

mat

(matrix or data.frame) matrix or data.frame

cond

(logical or integer) condition/test to see which values of mat fulfull test, or integer of index passing

sortByRows

(logical) optional sorting of results by row-index

silent

(logical) suppress messages

debug

(logical) display additional messages for debugging

callFrom

(character) allow easier tracking of messages produced

Value

This function returns a matrix with the columns 'row' and 'col'

See Also

which

Examples

set.seed(2021); ma1 <- matrix(sample.int(n=40,size=27,replace=TRUE), ncol=9)
## let's test which values are >37
which(ma1 >37)      # doesn't tell which row & col
coordOfFilt(ma1, ma1 >37)


wrMisc documentation built on Nov. 18, 2026, 5:06 p.m.