From e13fcb2ea1036d7ed93551f1fb5d6939361690fe Mon Sep 17 00:00:00 2001 From: aho Date: Fri, 21 May 2021 11:47:26 +0200 Subject: [PATCH] Add check for 'sdate' --- R/PlotAno.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/PlotAno.R b/R/PlotAno.R index 08a9ab8..9a4a971 100644 --- a/R/PlotAno.R +++ b/R/PlotAno.R @@ -110,6 +110,11 @@ PlotAno <- function(exp_ano, obs_ano = NULL, sdates, toptitle = rep('', 15), } else { nobs <- 0 } + # sdate check + if (!all(nchar(sdates) == 8)) { + stop ("The parameter 'sdates' must be formatted as YYYYMMDD.") + } + if (is.null(limits) == TRUE) { if (memb) { ll <- min(min(exp_ano, na.rm = TRUE), min(obs_ano, na.rm = TRUE), na.rm = TRUE) -- GitLab