-
Notifications
You must be signed in to change notification settings - Fork 417
Closed
Labels
featurea feature request or enhancementa feature request or enhancementperformance 🏎️pivoting ♻️pivot rectangular data to different "shapes"pivot rectangular data to different "shapes"vctrs ↗️
Description
Right here:
Lines 259 to 265 in d46d22a
out <- vec_c(!!!val_cols, .ptype = val_type) | |
# Interleave into correct order | |
# TODO somehow `t(matrix(x))` is _faster_ than `matrix(x, byrow = TRUE)` | |
# if this gets fixed in R this should use `byrow = TRUE` again | |
n_vals <- nrow(data) * length(val_cols) | |
idx <- t(matrix(seq_len(n_vals), ncol = length(val_cols))) | |
vals[[value]] <- vec_slice(out, as.integer(idx)) |
As a follow up to #1132, which should make pivot_longer()
a little faster, maybe do a benchmark against that PR.
Will require vctrs 0.3.9
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancementperformance 🏎️pivoting ♻️pivot rectangular data to different "shapes"pivot rectangular data to different "shapes"vctrs ↗️