Calculate which points fall in a box.
in1which(p, box)
p
data frame of points with columns x and y and many rows.
box
data frame of 1 row with columns left right top bottom.
Toby Dylan Hocking