I have a large data frame of genetic loci, and I'm trying to group it by gene based on similar start-end values. The difference between the end values between rows should not exceed 2000, for example, to be counted as the same gene.
Note
Lines <- "Start End
5000 6000
12000 13000
37000 38000
38500 39000"
DF <- read.table(text = Lines, header = TRUE)