First day of the week problem while using xts's period.apply()

60 Views Asked by At

I am trying to convert my daily series to weekly frequency by using xts package. However, I couldn't figure out how to dictate the first week of my series is Sunday. Documentation on function doesn't refer any arguments which can be used for this operation.

my_xts <- xts(mydf[, -1], order.by = mydf$Date, tzone = Sys.getenv("TZ"))
my_xts_weekly <- period.apply(my_xts, endpoints(my_xts, on = "weeks"), colSums)
nrow(my_xts_weekly)
0

There are 0 best solutions below