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的一些内容,但我不知道如何将它分配给索引。