Extract column values using range R
I have two datasets, each has a site column, an x column and a y column. dataset A has an additional column of jph, dataset B has additional columns of xplus1, xminus1, yplus1, yminus 1, and size class. For each site, I want to pull the jph from dataset A when the x and y coordinates are within the range of dataset B’s xminus1, xplus1, yplus1, yminus1, and retain the size class and site from dataset B. How can I do this in R with dplyr?