Page 1 of 1

# Get day of the week from date to incorporate intra-week trends (model_data <- model_data%% mutate (day=wday (date, abb

Posted: Sat May 14, 2022 4:39 pm
by answerhappygod
Get Day Of The Week From Date To Incorporate Intra Week Trends Model Data Model Data Mutate Day Wday Date Abb 1
Get Day Of The Week From Date To Incorporate Intra Week Trends Model Data Model Data Mutate Day Wday Date Abb 1 (24.46 KiB) Viewed 32 times
I need help fixing the error in this code
# Get day of the week from date to incorporate intra-week trends (model_data <- model_data%% mutate (day=wday (date, abbr = TRUE, label=TRUE), # Get day of the week from date to incorporate intra-week trends month=month(date, abbr = TRUE, label=TRUE), day=as_factor (day), month=as_factor (month))) # Get month from date to incorporate trends over a month Error in 'mutate: Problem while computing day = wday (date, abbr = TRUE, label = TRUE) Caused by error in 'as.Posixīt.default ! do not know how to convert 'x' to class "POSIXTt" Backtrace: 1. model_data%>% ... 8. lubridate:::wday.default(date, abbr = TRUE, label = TRUE) 11. base:: as.POSIXTt.default(x, tz = tz(x)) 12. base :: stop(...) Error in mutatec., day = wday (date, abbr = TRUE, label = TRUE), month = month(date, : Caused by error in 'as.Postxlt.default: do not know how to convert 'x' to class "POSIX1t" t Show Traceback