Add an index (numeric ID) column to large data frame

create a column of sequential numbers in r
r add row number as variable
assign unique id in r
r dataframe index column
r add index column by group
add column to dataframe r
r create unique id for each row
rename column in r