I think your problem is well suited for using the cut function in the R base:
df$to.remove <- is.na(cut(df$x, breaks = ranges[1,][,-1])) | is.na(cut(df$y, breaks = ranges[2,][,-1]))
is.na(...) will give you a logical vector in which values โโfrom the specified range are TRUE . Finally, you use the | , namely or , to decide which ones to remove.
To clear the data, you just need to do this:
df <- df[!df$to.remove,]
EDIT
I just noticed (from your comment) that your data frame contains more variables than just x and y . In this case, you can define a function named f and do the following for the number of variables that you have in your data frame.
f <- function(x, xrange, y, yrange) { (is.na(cut(x, breaks = xrange)) | is.na(cut(y, breaks = yrange)))} res <- f(df$x, ranges[1,][-1], df$y, ranges[2,][-1])
<strong> data
df <- structure(list(id = 1:4, x = c(2L, -1L, 5L, 4L), y = c(30521L, 1835L, 25939L, 1000000L)), .Names = c("id", "x", "y"), class = "data.frame", row.names = c(NA, -4L)) ranges <- structure(list(var = structure(1:2, .Label = c("x", "y"), class = "factor"), min = c(1L, 0L), max = c(5L, 99999L)), .Names = c("var", "min", "max"), class = "data.frame", row.names = c(NA, -2L))