powered by
Get coordinates of values/points in matrix according to filtering condition
coordOfFilt(mat, cond, sortByRows = FALSE, silent = FALSE, callFrom = NULL)
matrix columns 'row' and 'col'
(matrix or data.frame) matrix or data.frame
(logical or integer) condition/test to see which values of mat fulfull test, or integer of index passing
mat
(logical) optional sorting of results by row-index
(logical) suppress messages
(character) allow easier tracking of message(s) produced
which
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)
Run the code above in your browser using DataLab