From d42043de61aa77f49935034d34112c860e572d01 Mon Sep 17 00:00:00 2001 From: Andrew Gene Brown Date: Sat, 24 Feb 2024 19:11:05 -0800 Subject: [PATCH] `hzdesgn` argument default: update corresponding to #309 --- R/thicknessOf.R | 6 +++++- man/thicknessOf.Rd | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/R/thicknessOf.R b/R/thicknessOf.R index 89cc3f1e..9fdfbf78 100644 --- a/R/thicknessOf.R +++ b/R/thicknessOf.R @@ -49,7 +49,7 @@ #' thicknessOf <- function(x, pattern = NULL, - hzdesgn = guessHzDesgnName(x, required = TRUE), + hzdesgn = hzdesgnname(x, required = TRUE), method = "cumulative", prefix = "", thickvar = "thickness", @@ -60,6 +60,10 @@ thicknessOf <- function(x, .internalTHK <- NULL .interalHZM <- NULL + if (is.null(hzdesgn) || !hzdesgn %in% horizonNames(x)) { + stop("Horizon designation column (", hzdesgn, ") does not exist.") + } + # check inputs method <- match.arg(tolower(gsub("/", "", method)), c("cumulative", "minmax")) stopifnot(length(thickvar) == 1) diff --git a/man/thicknessOf.Rd b/man/thicknessOf.Rd index 51e6a66f..c3f74c38 100644 --- a/man/thicknessOf.Rd +++ b/man/thicknessOf.Rd @@ -7,7 +7,7 @@ thicknessOf( x, pattern = NULL, - hzdesgn = guessHzDesgnName(x, required = TRUE), + hzdesgn = hzdesgnname(x, required = TRUE), method = "cumulative", prefix = "", thickvar = "thickness",