From 1e94d8687c47e104763c80c81779ef4da8e5c49d Mon Sep 17 00:00:00 2001 From: ARIADNA BATALLA FERRES Date: Thu, 5 Sep 2024 14:47:50 +0200 Subject: [PATCH 1/3] Warning added for ref = NULL in RMSSS.R --- R/RMSSS.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/RMSSS.R b/R/RMSSS.R index 0326bfa..14ba89c 100644 --- a/R/RMSSS.R +++ b/R/RMSSS.R @@ -145,6 +145,10 @@ RMSSS <- function(exp, obs, ref = NULL, time_dim = 'sdate', dat_dim = NULL, } } else { ref <- 0 + warning("If a reference dataset is not provided (ref = NULL), the default ", + "value for the climatology is 0 and RMSSS results will only be ", + "correct if 'exp' and 'obs' are anomalies. Provide a non-null ", + "'ref' for full-field data.") } if (!is.array(ref)) { # 0 or 1 ref <- array(data = ref, dim = dim(exp)) -- GitLab From 0616c48e7d6996c3a66346bca09f3489f1519ead Mon Sep 17 00:00:00 2001 From: ARIADNA BATALLA FERRES Date: Thu, 5 Sep 2024 14:48:28 +0200 Subject: [PATCH 2/3] Warning added for ref = NULL in MSSS.R --- R/MSSS.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/MSSS.R b/R/MSSS.R index c37e66f..99dd6cf 100644 --- a/R/MSSS.R +++ b/R/MSSS.R @@ -135,6 +135,10 @@ MSSS <- function(exp, obs, ref = NULL, time_dim = 'sdate', dat_dim = NULL, } } else { ref <- 0 + warning("If a reference dataset is not provided (ref = NULL), the default ", + "value for the climatology is 0 and MSSS results will only be ", + "correct if 'exp' and 'obs' are anomalies. Provide a non-null ", + "'ref' for full-field data.") } if (!is.array(ref)) { # 0 or 1 ref <- array(data = ref, dim = dim(exp)) -- GitLab From 84d5b79007f7c4462915725c5f7000a82194e90d Mon Sep 17 00:00:00 2001 From: ARIADNA BATALLA FERRES Date: Thu, 5 Sep 2024 15:32:48 +0200 Subject: [PATCH 3/3] Change warning() for .warning() in RMSSS.R and MSSS.R warning --- R/MSSS.R | 2 +- R/RMSSS.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/MSSS.R b/R/MSSS.R index 99dd6cf..ca854f3 100644 --- a/R/MSSS.R +++ b/R/MSSS.R @@ -135,7 +135,7 @@ MSSS <- function(exp, obs, ref = NULL, time_dim = 'sdate', dat_dim = NULL, } } else { ref <- 0 - warning("If a reference dataset is not provided (ref = NULL), the default ", + .warning("If a reference dataset is not provided (ref = NULL), the default ", "value for the climatology is 0 and MSSS results will only be ", "correct if 'exp' and 'obs' are anomalies. Provide a non-null ", "'ref' for full-field data.") diff --git a/R/RMSSS.R b/R/RMSSS.R index 14ba89c..3d1de43 100644 --- a/R/RMSSS.R +++ b/R/RMSSS.R @@ -145,7 +145,7 @@ RMSSS <- function(exp, obs, ref = NULL, time_dim = 'sdate', dat_dim = NULL, } } else { ref <- 0 - warning("If a reference dataset is not provided (ref = NULL), the default ", + .warning("If a reference dataset is not provided (ref = NULL), the default ", "value for the climatology is 0 and RMSSS results will only be ", "correct if 'exp' and 'obs' are anomalies. Provide a non-null ", "'ref' for full-field data.") -- GitLab