I would like to find, given an input number, the corresponding element of the list that is greater than or equal to the input number. I found an example solution online, but it only gives me the closest number, not the closest number that's greater than or equal to the input number (ie. it will select a number below the input if that number is closer)
Example:
x=c(1:10^6)
your.number=90000.43
which.min(abs(x-your.number))
[1] 90000
Here the code returns 90000, but I would need it to return 90001 since this is the closest number greater than or equal to the input
Thanks!!!