This function adds a new column to a data frame containing a unique identifier for each row. The default column name is ".id", but this can be customized using the name parameter.
Examples
df <- data.frame(x = c(1, 2, 3), y = c("a", "b", "c"))
add_row_id(df)
#> x y .id
#> 1 1 a 1
#> 2 2 b 2
#> 3 3 c 3