Skip to content

Commit

Permalink
Prefer lengths()
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr authored and aviator-bot committed Jan 11, 2024
1 parent ce19842 commit a3c7973
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ try_silent <- function(code) {
check_df <- function(df) {
expect_s3_class(df, "data.frame")
if (length(df) >= 1L) {
lengths <- vapply(df, length, integer(1L), USE.NAMES = FALSE)
lengths <- unname(lengths(df))
expect_equal(diff(lengths), rep(0L, length(lengths) - 1L))
expect_equal(nrow(df), lengths[[1]])
}
Expand Down

0 comments on commit a3c7973

Please sign in to comment.