# NOT RUN {
# Run if HYDAT database has been downloaded (using tidyhydat::download_hydat())
if (file.exists(tidyhydat::hy_downloaded_db())) {
# Calculate the long-term mean annual discharge (MAD) using only years with no missing data
calc_longterm_mean(station_number = "08NM116",
complete_years = TRUE)
# Calculate the long-term MAD and 5, 10 and 20-percent MADs using only years with no missing data
calc_longterm_mean(station_number = "08NM116",
complete_years = TRUE,
percent_MAD = c(5,10,20))
}
# }
Run the code above in your browser using DataLab