Skip to content

Commit

Permalink
add comment about when aggregation is used
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed Oct 11, 2024
1 parent f01ffe2 commit 0098010
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions R/collapseHz.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0098010

Please sign in to comment.