R: Find position of first value greater than X in a vector -
in r: have vector , want find position of first value greater 100.
# randomly generate suitable vector set.seed(0) v <- sample(50:150, size = 50, replace = true) min(which(v > 100))
in r: have vector , want find position of first value greater 100.
# randomly generate suitable vector set.seed(0) v <- sample(50:150, size = 50, replace = true) min(which(v > 100))
Comments
Post a Comment