everyone I am new to R. I would like to find out the first and second maximums and their locations, using R studio. It would be appreciate if you could help me how to do that.
Example explanation:
I would like to find the two maximums (before and after depression - lowest value). In this picture, the first maximum will be 17 before the depression (lowest value), and the second maximum will be 16 after the depression (lowest value). Also, I would like to find out their locations on x-axis. The first maximum 17 will be on 5, and the second maximum will be on 11.