powered by
Returns row number. This function is designed to work inside of mutate.()
mutate.()
row_number.()
df <- data.table(x = rep(1, 3), y = c("a", "a", "b")) df %>% mutate.(row = row_number.()) # The dplyr version `row_number()` also works df %>% mutate.(row = row_number())
Run the code above in your browser using DataLab