DT1 <- data.table(Date = NA, Diff = 5)
DT1[!is.na(Date), val := Date + lubridate::days(Diff)]
Error in Date + lubridate::days(Diff) :
Arithmetic operators undefined for 'logical' and 'Period' classes:
convert one to numeric or a matching time-span class.
如果列日期为NA,则val为NA,我应该怎么做?目前,lubridate出错了。