Right here:
|
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
Right here:
tidyr/R/pivot-long.R
Lines 259 to 265 in d46d22a
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