I am working with several temperature datasets and trying to pull out when the temperature meets or exceeds a threshold value. Ideally, I want to know how many times (count) that value is met/ exceeded each year for ~100 yrs of data AND when (what date) that value is first exceeded and last exceeded in each year.

Data is in a table (.csv file brought into R) with columns YR, MO, DA, TMAX

For the first part, I have tried using subset to pull out all the times the temperature exceeds a value but then I still have to add up each year (time consuming)
subset(data, TMAX > 20.86)

I've figured out how to use count, but that gives me all the occurrences in the dataset
count(data, vars = "TMAX")

And I have played around with summarise but gotten no where. Any help would be appreciate- especially for the second part of my question- finding the first and last occurrence each year.

Here is sample data. This is SeatlleTMAX (rather than data) as it is the TMAX values for Seattle.
YR MO DA TMAX  

1909 9 1 28.9  

1909 9 2 30.0  

1909 9 3 28.3  

1909 9 4 33.9  

1909 9 5 31.7  

1909 9 6 28.3  

1909 9 7 26.7  

1909 9 8 23.3  

1909 9 9 22.2  

1909 9 10 17.8  

1909 9 11 14.4  

1909 9 12 25.6  

1909 9 13 23.9  

1909 9 14 25.0  

1909 9 15 29.4  

1909 9 16 28.3  

1909 9 17 14.4  

1909 9 18 21.7  

1909 9 19 14.4  

1909 9 20 13.3  

1909 9 21 15.6  

1909 9 22 20.6  

1909 9 23 23.3  

1909 9 24 20.0  

1909 9 25 21.1  

1909 9 26 22.2  

1909 9 27 25.6  

1909 9 28 22.2  

1909 9 29 15.0  

1909 9 30 12.2