Re: [R] Comparing dates in two large data frames

2021-04-10 Thread Rui Barradas
Hello, The following solution seems to work and is fast, like findInterval is. It first determines where in df2$start is each value of df1$Time. Then uses that index to see if those Times are not greater than the corresponding df$end. I checked against a small subset of df1 and the results wer

[R] Comparing dates in two large data frames

2021-04-10 Thread Kulupp
Dear all, I have two data frames (df1 and df2) and for each timepoint in df1 I want to know: is it whithin any of the timespans in df2? The result (e.g. "no" or "yes" or 0 and 1) should be shown in a new column of df1 Here is the code to create the two data frames (the size of the two data f