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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 30 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply