Skip to content

Commit 17bcb6d

Browse files
avoid as_tibble()
speed boost ~ 4%
1 parent 66af505 commit 17bcb6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/compat-tidyr.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ nest_ <- function(data, key_col, nest_cols = character()) {
66
res <- list()
77
res[[key_column]] <- key_levels
88
res[[key_col]] <- split(data[, nest_cols], key_factor)
9-
as_tibble(res)
9+
new_tibble(res, nrow = length(key_levels))
1010
}

0 commit comments

Comments
 (0)