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