I am relatively new to R and I would like to know how can I create a variable (number sequence) that identifies the each of the original data.frames before being joined with
Thanks all! I ended up with a simple solution working with a friend of mine by creating an index, like this:
index<-rep(1,times=nrow(data.frame))
for (i in 1:(nrow(data.frame)-1)){
if (data_frame$ID [i+1]<= data.frame$ID[i]) {
index[i+1]<-index[i]+1
}
else {index[i+1]<-index[i]}}
new.data.frame <- cbind(index, data.frame)