Average over three values repeatedly in a column of a dataframe taking into account multiple spots

A reproducible example, called a reprex would be really helpful to give a specific suggestion.

If I understand correctly, you have or can create, say, a 3x1 matrix of years,highOZ

years <- c(1,2,3)
ozone <- c(0,1,1)
m <- as.matrix(years,ozone)
m
#>      [,1]
#> [1,]    1
#> [2,]    2
#> [3,]    3
mean(m)
#> [1] 2

Created on 2019-12-20 by the reprex package (v0.3.0)

The result is the mean number of years across one measuring station of ozone concentrations > 120ug/m3 (1 or TRUE). You can extend that of course to n stations.