I have written code that outputs the total rainfall for a set amount of years. My question is how would I just display the year with the largest and smallest rainfall i.e the maximum and minimum of the dataset with the corresponding year.
The output i have so far is: (but i just want the maximum and minimum of the vector with the corresponding year so with this output, only 2011 and 2012 should be displayed)