I get the following error message:
Error in if (sum(c(new$hour, new$min, new$sec))) { :
argument is not interpretable as logical
when I execute the following code:
keep$EstimateDate <- as.Date(keep$date + keep$days,"%Y-%m-%d")
keep$EstimateDateWeekStart <- floor_date(keep$EstimateDate,"week") #+1
The keep$EstimateDate
is a column in a data.table with properly formatted dates.
The floor_date()
is a function in the lubridate
package.