In R: I have a vector and want to find the position of the first value that is greater than 100.
Just to mention, Hadley Wickham has implemented a function, detect_index
, to do exactly this task in his purrr
package for functional programming.
I recently used detect_index
myself and would recommend it to anyone else with the same problem.
Documentation for detect_index
can be found here: https://rdrr.io/cran/purrr/man/detect.html