Skip to content

Commit

Permalink
Fix invalid multibyte string
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Aug 29, 2023
1 parent 7c86d71 commit e23fce0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/remove_empty.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ empty_columns <- function(x) {
} else {
all_na <- colSums(is.na(x)) == nrow(x)
all_empty <- vapply(x, function(i) {
(is.character(i) || is.factor(i)) && max(c(0, nchar(as.character(i))), na.rm = TRUE) == 0
(is.character(i) || is.factor(i)) && !any(nzchar(as.character(i)))
}, FUN.VALUE = logical(1L))

which(all_na | all_empty)
Expand Down

0 comments on commit e23fce0

Please sign in to comment.