Skip to content

Commit

Permalink
Fix compact_list() for labelled + other vctrs classes
Browse files Browse the repository at this point in the history
  • Loading branch information
bwiernik committed Jun 1, 2024
1 parent 24c23c4 commit 85eb328
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/utils_compact.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#' @export
compact_list <- function(x, remove_na = FALSE) {
if (remove_na) {
x[!sapply(x, function(i) !is_model(i) && !inherits(i, c("Formula", "gFormula")) && (length(i) == 0L || is.null(i) || (length(i) == 1L && is.na(i)) || all(is.na(i)) || any(i == "NULL", na.rm = TRUE)))]
x[!sapply(x, function(i) !is_model(i) && !inherits(i, c("Formula", "gFormula")) && (length(i) == 0L || is.null(i) || (length(i) == 1L && is.na(i)) || all(is.na(i)) || any(sapply(i, identical, y = "NULL"), na.rm = TRUE)))]

Check warning on line 13 in R/utils_compact.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/utils_compact.R,line=13,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 225 characters.
} else {
x[!sapply(x, function(i) !is_model(i) && !inherits(i, c("Formula", "gFormula")) && (length(i) == 0L || is.null(i) || any(i == "NULL", na.rm = TRUE)))]
x[!sapply(x, function(i) !is_model(i) && !inherits(i, c("Formula", "gFormula")) && (length(i) == 0L || is.null(i) || any(sapply(i, identical, y = "NULL"), na.rm = TRUE)))]

Check warning on line 15 in R/utils_compact.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/utils_compact.R,line=15,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 175 characters.
}
}

Expand Down

0 comments on commit 85eb328

Please sign in to comment.