[R-SIG-Finance] getting a subset corresponding to a list element

Daniel Cegiełka daniel.cegielka at gmail.com
Fri May 26 23:53:28 CEST 2017

2017-05-26 22:58 GMT+02:00 Michael Ashton <m.ashton at enduringinvestments.com>:
> I'm not sure how to ask this with the proper terminology, but here goes:

> So, if I run the query with 3 symbols, I get a list with 3 elements. For example, in this case, if


> But I don't WANT a list. I want a zoo object containing each of these as an element.

use my src.bloomberg.R custom code and try this:


# works with and without suffix 'Index' etc. :)

getSymbols.bloomberg(c('SPX', 'MXWO', 'MXEA'), from = as.Date(begdate))

# PX_LAST: SYM[,4] or Cl(SYM)
sym_data <- merge(SPX[,4], MXWO[,4], MXEA[,4])


zoo_data <- as.zoo(sym_data)

btw. "to" arg is set as "to = Sys.Date() - 1" (EOD data)

getSymbols.bloomberg <- function(symbols = NULL, exchcode = 'US',
from = Sys.Date() - 365, to = Sys.Date() - 1, env = .GlobalEnv,
auto.assign, verbose, ...)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: src.bloomberg.R
Type: application/octet-stream
Size: 2401 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20170526/bbcf3415/attachment.obj>

More information about the R-SIG-Finance mailing list