Skip to content

Commit

Permalink
NA in by argument not allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed Oct 11, 2024
1 parent 5bcac07 commit 268497d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/collapseHz.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ collapseHz <- function(x,
# calculate matches
if (!is.null(by) && length(pattern) == 1 && is.na(pattern)) {
labels <- h[[by]]

if (any(is.na(labels))) {
stop("Missing values are not allowed in `by` column argument", call. = FALSE)
}

r <- rle(paste0(h[[idn]], "-", as.character(labels)))
l <- rep(TRUE, nrow(h))
} else {
Expand Down

0 comments on commit 268497d

Please sign in to comment.