How to overcome error:“attempt to set 'colnames' on an object with less than two dimension” in xts object
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to add an open price as a new row at the end of a "SPY" data frame that was produce using the quantmod package, I used the following code in order to rbind the new row but I got an error # rm(list = ls()) # generally considered as bad manner in an MWE require(quantmod) options(scipen=999) spy <- getSymbols(("SPY") , src = 'yahoo', from = '2016-01-01', auto.assign = T) spy<-cbind(SPY) tail(SPY) SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.Adjusted 2016-01-14 189.55 193.26 187.66 191.93 240795600 191.93 2016-01-15 186.77 188