How do I reference the row number of an observation? For example, if you have a data.frame called \"data\" and want to create a variable data$rownumber
data.frame
data$rownumber
Perhaps with dataframes one of the most easy and practical solution is:
data = dplyr::mutate(data, rownum=row_number())