Skip to content
Prev 8873 / 15274 Next

expanding xts object - adding a day

Hello

this does it for one stock. I am struggling when I insert  this expression in a 
loop that worked before:

tickers <- c("MSFT","CSCO","GE")
getSymbols ( tickers, from="2011-07-01::")
qte <- getQuote ( tickers )
for(ticker in tickers) {
tacker <- rbind((ticker), xts(qte[ticker,c(5,6,7,2,82)],Sys.Date()))
...}
gives for tacker "Error in UseMethod("as.xts"), because ticker is read in this 
context as class "character"

Any workaround to get "ticker" into class xts?

Thanks in advance
Hans

Am Donnerstag, 3. November 2011 17:01:56 schrieben Sie:
-----------------------------------------------------------------------------------------------------------------------------------------
Hans Grapenthin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20111106/38bbc803/attachment.bin>