# NOT RUN {
ts_dat <- make_whole(sst_WA)
res <- detect(ts_dat, climatology_start = "1983-01-01",
climatology_end = "2012-12-31")
mhw <- res$clim
mhw <- mhw[10580:10690,]
# }
# NOT RUN {
require(ggplot2)
ggplot(mhw, aes(x = t, y = temp)) +
geom_flame(aes(y2 = thresh_clim_year)) +
geom_text(aes(x = as.Date("2011-02-01"), y = 28,
label = "That's not a heatwave.\nThis, is a heatwave.")) +
xlab("Date") + ylab(expression(paste("Temperature [", degree, "C]")))
# }
Run the code above in your browser using DataLab