Skip to content

Commit c4c61de

Browse files
committed
replace df_rows() with vec_slice()
1 parent a5a1ce5 commit c4c61de

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

R/compat-plyr.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ dapply <- function(df, by, fun, ..., drop = TRUE) {
293293
ids <- id(grouping_cols, drop = drop)
294294
group_rows <- split_with_index(seq_len(nrow(df)), ids)
295295
result <- lapply(seq_along(group_rows), function(i) {
296-
cur_data <- df_rows(df, group_rows[[i]])
296+
cur_data <- vec_slice(df, group_rows[[i]])
297297
apply_fun(cur_data)
298298
})
299299
vec_rbind0(!!!result)

R/performance.R

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ mat_2_df <- function(x, col_names = colnames(x)) {
1010
data_frame0(!!!cols, .size = nrow(x))
1111
}
1212

13-
df_rows <- function(x, i) {
14-
cols <- lapply(x, `[`, i = i)
15-
data_frame0(!!!cols, .size = length(i))
16-
}
17-
1813
# More performant modifyList without recursion
1914
modify_list <- function(old, new) {
2015
for (i in names(new)) old[[i]] <- new[[i]]

0 commit comments

Comments
 (0)