From a3c7973989ec725b37c35dbecd607130f2561757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Thu, 11 Jan 2024 18:56:06 +0100 Subject: [PATCH] Prefer lengths() --- R/utils.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/utils.R b/R/utils.R index 385476a05..2e1b06a1f 100644 --- a/R/utils.R +++ b/R/utils.R @@ -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]]) }