1
我想設置一個xts對象的特定日期,但它有一天會改變日期。如何將確切的索引()分配給xts對象
aapl <- as.xts(read.zoo(textConnection("
2007-04-26, 98.84
2007-04-27, 99.92
2007-04-30, 99.80
2007-05-01, 99.47
2007-05-02, 100.39"), sep=","))
idx_aapl <- index(aapl)
idx_aapl
xts:::index.xts(aapl) # makes no difference
idx_aapl <- idx_aapl + 1
idx_aapl
如何指定顯示的具體日期?我已經閱讀了posixct的一些內容,但我不知道如何將它分配給索引。