Let
m <- 3*matrix(1:12, 3, 4)
using the which() function I then can access all entries that are above a given threshold like so
which(m > 25)
which returns a list of integer entry indices, or
which(m > 25, arr.ind = TRUE) returning more matrix-like indices.
However I cannot use something like m[which(m > 25)] in order to change those values (say to 100). I would greatly appreciate any pointers :)