I have the following code:
library(quantmod)
tckrs <- c("TLT", "LQD", "HYG", "SPY", "DBC")
NumTckrs <- length(tckrs)
getSymbols(tckrs, from="1900-01-01", to=Sys.Date())
# merge to allign the start dates
MainDF <- merge(Ad(TLT), Ad(LQD), Ad(HYG), Ad(SPY), Ad(DBC), all=FALSE)
I would like to not have to repeat the stock symbols in the last line. Does anyone know how this could be done?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…