Wrong week-ending date using 'to.weekly' function in 'xts' package
问题 I have a really odd issue... I am using the to.weekly and to.period function to convert a daily xts object to weekly data. In most instances, I get the week-ending date as a Friday ( day.of.week function will return 5) (e.g. "2010-01-08" , "2011-02-11" ), but there are a few cases where I get something other than Friday (Saturday/Sunday/Thursday/etc.) I have tried to.weekly and to.period(x, period = 'weeks') and both return the same problem. Why is this happening? Is there a work-around for