hey #RStats and #tidyverse, in what other ways would you answer this question:
2
2
8
It seems that the answer does not coincide with difftime() gives.
Below is a shorter @rdatatable solution which gives the same answer as base R.
data.table(now=Sys.Date())[
, st:=as.IDate(paste0(year(now)-3,"-01-01"))][
, d:=difftime(now,st)][]
#rstats
Feb 7, 2020 · 10:52 PM UTC
1
10



