I'm working with a dataset that looks something like this, except there are many more columns with data like "serial" and "loc":
start <-c(1,8,16,24,28,32)
end <-c(4,9,20,27,30,45)
serial<-c(1,2,3,4,5,6)
loc<-c(8,63,90,32,89,75)
dataset<-data.frame(cbind(start,end, serial,loc))
Here each row actually represents a run of consecutive integers; I'd like to make each of those consecutive integers into its own row and conserve the other attributes of that row. "start" indicates the beginning of a run and "end" represents the end of the run. So, for example, in the first row in "dataset", I would like to have that row separated into four rows: one for 1, one for 2, one for 3, and one for 4. Likewise, the second row in "dataset" would be split into two rows: one for 8 and one for 9 etc.
Thus the output for running just the first two lines of "dataset" would look like:
split serial loc
1 1 8
2 1 8
3 1 8
4 1 8
8 2 63
9 2 63