
Last chance! 50% off unlimited learning
Sale ends in
Generate a plot representing percentiles of cumulative precipitation, given a historic record, and criteria for selecting a year of data for comparison.
PCP_plot(x, this.year, this.day = NULL, method = "exemplar",
q.color = "RoyalBlue", c.color = "firebrick", ...)
result from CDECquery()
for now, will need to generalize to other sources
a single water year, e.g. 2020
optional integer representing days since start of selected water year
'exemplar' or 'daily', currently 'exemplar' is the only method available
color of percentiles cumulative precipitation
color of selected year
addtional arguments to plot()
Currently nothing is returned.
This is very much a work in progress. Further examples at https://ncss-tech.github.io/AQP/sharpshootR/CDEC.html, and https://ncss-tech.github.io/AQP/sharpshootR/cumulative-PPT.html
# NOT RUN {
if(requireNamespace("curl") &
curl::has_internet()
) {
s <- 'SPW'
# get metadata
s.info <- CDEC_StationInfo(s)
# format title for cumulative PPT
title.text <- sprintf("%s [%s]", s.info$site.meta$Name, s)
# get data
x <- CDECquery(id=s, sensor=45, interval='D', start='2000-01-01', end='2030-01-01')
## NOTE: requires sharpshootR >= 1.6.1
# plot
par(mar=c(4.5, 4.5, 2.5, 1.5))
PCP_plot(x[1:(nrow(x)-60), ], ylab='Cumulative PPT (inches)', main=title.text, this.year = 2020)
}
# }
Run the code above in your browser using DataLab