I want have variable row in such a way that for soo1
the row is just 1, for soo1
the row is 2…. Any thoughts?
library(dplyr)
data1 <- tibble(
"id" = c("soo1", "soo1", "soo2", "soo2", "soo3"),
"amount" = c(100, 21, 23, 23, 45)
) |>
group_by(id) |>
mutate(row = row_number())