I need to create a column with unique ID, basically add the row number as an own column. My current data frame looks like this:
V1 V2 1 23 45 2 45 4
Many presented their ideas, but I think this is the sortest and simplest code for this task:
data$ID <- 1:nrow(data)
One line. The one and only.