Re: [R] removing data based on date pairs in a separate data frame

2016-02-29 Thread William Dunlap via R-help
If your start/end pairs are not overlapping you can use findInterval() to do this pretty quickly. E.g., isInABound <- function (x, low, high) { stopifnot(length(low) == length(high)) bounds <- rep(low, each = 2) bounds[seq(2, length(bounds), by = 2)] <- high stopifnot(!is.unsorted(

Re: [R] removing data based on date pairs in a separate data frame

2016-02-29 Thread Bert Gunter
What is the format of your date columns? -- character, factor, POSIXxx,... ?? See ?str to find out. (Reply to the list, not just me; others are far more facile at dates than I am). Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking th

[R] removing data based on date pairs in a separate data frame

2016-02-29 Thread Thomas Barningham
Dear R users, I have two data frames. The first contains a date/time column and the concentration of a species: head(mydata) datespecies 1 2016-01-31 23:59:53 -559.17 2 2016-02-01 00:00:53 -556.68 3 2016-