I have this data
cluster<-c(1,1,1,1,2,2,2,2)
structure<-c(1,1,2,3,1,1,1,2)
str<-data.frame(clusters,structures)
i want to create a third column called serial numbers based on the cluster and structure. this is in such a way that i get the following output
serial.number<-c(1,2,1,1,1,2,3,1)
str2<-data.frame(cluster,structure,serial.number)
thankyou