Skip to content

Commit

Permalink
Add message to stopifnot() call
Browse files Browse the repository at this point in the history
  • Loading branch information
aphalo committed Dec 28, 2023
1 parent fb90f9e commit c3bed80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/spct.conversion.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c3bed80

Please sign in to comment.