In my code, I want to get the row of the y range that comes after the x range by using the code below. But when I run the code, I get the row of the y range that comes before the x range. Precede gives the opposite.
y <- data.frame('seqnames' = c('chr11', 'chr11'), 'start' = c(62789197, 62789292), 'end' = c(62789210, 62789426), strand = c('+', '+')) x <- data.frame('seqnames' = 'chr11', 'start' = 62789211, 'end' = 62789271, strand = '+') x <- GenomicRanges::makeGRangesFromDataFrame(x, ignore.strand = F) y <- GenomicRanges::makeGRangesFromDataFrame(y, ignore.strand = F) x <- GenomicRanges::GRanges(seqnames(x), IRanges(end(x), end(x)), strand = strand(x)) y <- GenomicRanges::GRanges(seqnames(y), IRanges(start(y), start(y)), strand = strand(y)) IRanges::follow(x, y, select = 'last', ignore.strand = F)