diff --git a/R/collapseHz.R b/R/collapseHz.R index ec470ef0..b08fb1ff 100644 --- a/R/collapseHz.R +++ b/R/collapseHz.R @@ -178,6 +178,7 @@ collapseHz <- function(x, r <- rle(l) } + # only apply aggregation if there are adjacent horizons that match the target criteria if (any(r$lengths > 1)) { g <- unlist(lapply(seq_along(r$lengths), function(i) rep(i, r$lengths[i]))) hidx <- unlist(lapply(seq_along(r$lengths), function(i) if (r$lengths[i] == 1) TRUE else rep(FALSE, r$lengths[i]))) & l