From c3bed806a1ba7c54aae09020701ab28c9ab05727 Mon Sep 17 00:00:00 2001 From: Pedro Aphalo Date: Fri, 29 Dec 2023 00:59:37 +0200 Subject: [PATCH] Add message to stopifnot() call --- R/spct.conversion.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/spct.conversion.R b/R/spct.conversion.R index 63d0936f..6b6dca72 100644 --- a/R/spct.conversion.R +++ b/R/spct.conversion.R @@ -51,7 +51,8 @@ cps2irrad <- function(x.sample, x.sample <- pre.fun(x.sample, ...) } cps.col.sample <- grep("^cps", names(x.sample), value = TRUE) - stopifnot(length(cps.col.sample) == 1) + stopifnot("Multiple 'cps' columns found when one expected" = + length(cps.col.sample) == 1) z <- as.generic_spct(x.sample) z[[cps.col.sample]] <- NULL z[["s.e.irrad"]] <- x.sample[[cps.col.sample]] * irrad.mult