How to add a column with an index to an apache arrow dataset in R?

Viewed 107

I'm trying to add an index to a dataset which is too large to fit in RAM. The tidyverse way of adding an index would be:

library(tidyverse)
df = mtcars
df |>
  mutate(row_id = 1:nrow(cyl)) # any column name in the df

Dplyr backend for Arrow doesn't allow for this operation. How else can I do it?

0 Answers
Related