When rbind
ing multiple dataframes, I'd like to indicate where the former dataframes started. So when using:
df1<-data.frame(c(1,2,3,4),rnorm(1:4),rnorm(1:4),rnorm(1:4))
df2<-data.frame(c(1,2,3,4),rnorm(1:4),rnorm(1:4),rnorm(1:4))
dfTotal<-rbind(df1,df2)
I'd like to have an indicator where df2 has started in dfTotal.
Two questions:
- Can this be done?
- Is there a better way to have the first column just go from 1 to 8?