Ok. So, it's not exactly the same as your earlier question since this is an XTS
object. Still, very easy to take care of:
data.frame(date = index(weeklyReturn(SDB)),
weeklyReturn(SDB), row.names=NULL)
# date weekly.returns
# 1 2010-01-04 -0.03303426
# 2 2010-01-11 -0.04681569
# 3 2010-01-18 -0.05000000
# 4 2010-01-25 0.03353517
# 5 2010-02-01 -0.04281208
For help on what is being done here, view use ?indexClass
to read the documentation for index
in the XTS
package.