# Extract event statistics and plot the maxima
event.indices = eventPOT(dataLoch, out.style = "none")
event.stats = calcStats(event.indices$srt, event.indices$end, dataLoch)
print(event.stats)
plot(1:length(dataLoch), dataLoch, type = "h", lwd = 2, col = "steelblue",
ylab = "Rainfall (mm)", xlab = "Time index", mgp = c(2, 0.6, 0))
points(event.stats$which.max, event.stats$max, col = "red", pch = 16, cex = 1.2)
legend("topright", legend = c("Rainfall", "Max"), cex = 0.8,
lwd = c(2, NA), pch = c(NA, 16), col = c("steelblue", "red"), bty = "n")
Run the code above in your browser using DataLab