I apologize if this question is abhorrently simple, but I\'m looking for a way to just add a column of consecutive integers to a data frame (if my data frame has 200 observation
Or use dplyr.
dplyr
library(dplyr) df %>% mutate(observation = 1:n())
You might want it to be the first column of df.
df
df %>% mutate(observation = 1:n()) %>% select(observation, everything())