I have a data frame that looks something like this:
my_data <- structure(list(chr = c("chr14", "chr14", "chr14", "chr14", "chr14", "chr14", "chr14", "chr14", "chr14", "chr14"), start = c(1245841L, 4729880L, 5042400L, 6129542L, 6130563L, 6131756L, 6135211L, 6139073L, 6144706L, 6145560L), end = c(1245858L, 4729897L, 5042417L, 6129559L, 6130580L, 6131773L, 6135228L, 6139090L, 6144723L, 6145577L)), class = "data.frame", row.names = c(NA, -10L))
I now wish to make a new data_frame where only a certain picked combination of the row exists. I'd like to create a new data frame with only the rows in which start value >= 6129542 and end value <= 6145577.
I tried with this combination but it doesn't work
library(tidyverse)
new_data <- my_data %>% filter(start >= 6129542 |
end <= 6145577)
Could Could you help me find a solution?