检查日期是否在润滑时间间隔之前

时间:2019-02-26 16:05:46

标签: r lubridate

我有一张桌子,如下:

structure(list(t.collectiondate.x = structure(c(15696, 15244), class = "Date"), 
t.collectiondate.y = structure(c(15353, 15793), class = "Date"), 
int = structure(c(345600, 0), start = structure(c(1356739200, 
1364601600), class = c("POSIXct", "POSIXt"), tzone = "UTC"), tzone = "UTC", class = structure("Interval", package = "lubridate"))), .Names = c("t.collectiondate.x", "t.collectiondate.y", "int"), row.names = c(NA,-2L), class = c("tbl_df", "tbl", "data.frame"))


collection_date.x    collection_date.y    interval
2012-12-22           2012-01-14           2012-12-29--2013-01-02

我想知道两个收集日期是否都在间隔之前发生。
我尝试过:

collection_date.x < df$int

但这有时给出错误的答案,例如:

df$collection_date.x < df$interval
[1] TRUE FALSE

我在做错什么/如何实现我想要的?

0 个答案:

没有答案