I'm working in R and have a large dataframe (my database= "db") that contains different m/z masses which correspond to a peptide sequence like such:

```
    peptide MZ
    WV  304.16558
    VR  274.18738
    VR  274.18738
    LP  229.15468
    IP  229.15468
    IP  229.15468
    FP  263.13903

```

And a second dataframe ("df") that has a range of MZ peptides like such:

```
mzmin        mzmax
296.2286    296.2584
296.8832    297.0105
299.1425    299.1511
301.1299    301.2393
301.0612    301.1668
302.106     302.1985

```

What I want to do is check if rows in the first data frame fits within the range of the second data frame and if so add the Peptide sequence (column 1 of the first data frame) to the second data frame.
Are there any R functions that could help me with accomplishing this task?

i've used:

```
# order the first data.frame by the ranges

df <- df[order(df[[1]]), ]

# create a vector breaks from the interval ranges

breaks <- as.vector(do.call(rbind, df[c(1,2)]))
ints <- ceiling(findInterval(db[[2]], breaks)/2)

df$ <- df[ints, 3]

```