Splitting a data frame into a list using intervals
问题 I want to split a data frame like this chr.pos nt.pos CNV 1 74355 0 1 431565 0 1 675207 0 1 783605 1 1 888149 1 1 991311 1 1 1089305 1 1 1177669 1 1 1279886 0 1 1406311 0 1 1491385 0 1 1579761 0 2 1670488 1 2 1758800 1 2 1834256 0 2 1902924 1 2 1978088 1 2 2063124 0 The point is to get a list of intervals where the chr are the same and CNV=1 column, but taking into account the 0 inervals between them [[1]] 1 783605 1 1 888149 1 1 991311 1 1 1089305 1 1 1177669 1 [[2]] 2 1670488 1 2 1758800 1