diff --git a/R/RPSS.R b/R/RPSS.R index 5c7006c31ff155049d9c09ae09dfb123546acf7d..62730d9d5ad25f125ed66215a98cbd4f7b0e46b0 100644 --- a/R/RPSS.R +++ b/R/RPSS.R @@ -262,6 +262,22 @@ RPSS <- function(exp, obs, ref = NULL, time_dim = 'sdate', memb_dim = 'member', any(prob_thresholds <= 0) | any(prob_thresholds >= 1)) { stop("Parameter 'prob_thresholds' must be a numeric vector between 0 and 1.") } + if (missing(prob_thresholds)) { + if (is.null(cat_dim) && is.null(ref)) { + .warning("Parameter 'prob_thresholds' is not provided. Default value c(1/3, 2/3) is used.\n", + "Since the inputs are ensemble members (i.e., 'cat_dim' is NULL) and no reference ", + "forecast is provided, this default will be used both to compute category ", + "probabilities and the reference climatology.") + } else if (is.null(cat_dim) && !is.null(ref)) { + .warning("Parameter 'prob_thresholds' is not provided. Default value c(1/3, 2/3) is used.\n", + "Since the inputs are ensemble members (i.e., 'cat_dim' is NULL), this default will ", + "be used to compute category probabilities.") + } else { # if (!is.null(cat_dim) && is.null(ref)) + .warning("Parameter 'prob_thresholds' is not provided. Default value c(1/3, 2/3) is used.\n", + "Since no reference forecast is provided, this default will be used to compute ", + "the reference climatology.") + } + } } ## indices_for_clim if (is.null(indices_for_clim)) {