Home > other >  How to separate but not split a data frame by differences in value between different rows?
How to separate but not split a data frame by differences in value between different rows?

Time:02-01

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.

screenshot

Note

Lines <- "Start End
5000 6000
12000 13000
37000 38000
38500 39000"
DF <- read.table(text = Lines, header = TRUE)
  • Related