This function is somewhat analogous to
subset.data.frame, but only one independent variable may be
used in subset in any call to the function, which means that
repeated calls will be necessary to subset based on more than one
independent variable (e.g. time and distance).