Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/getHoldings.SPDR.R
This function only works with the 9 Select Sector SPDRs: ‘XLY’, ‘XLP’, ‘XLE’, ‘XLF’, ‘XLV’, ‘XLI’, ‘XLB’, ‘XLK’, ‘XLU’.
1 2 | getHoldings.selectSPDR(Symbols, env = .GlobalEnv,
auto.assign = TRUE)
|
Symbols |
character vector of Select Sector SPDR ETF
symbols. If not provided, all 9 will be used. However,
in the future it may change to require that
|
env |
where to store holdings (only used if
|
auto.assign |
should the results be assigned in
|
It is usually called by getHoldings
, or
getHoldings.SPDR
but it can also be called
directly.
For each of the Symbols
, an object classed as
“holdings”. If auto.assign
is TRUE,
holdings will be assigned as the ETF symbols appended
with “.h”, and the names of those objects will be
returned. Otherwise, if Symbols
is only one
symbol, its holdings will be returned. If Symbols
is of length greater than one, a list will be returned
where each element is the holdings of a different ETF.
If there are no holdings found for a Symbol (most likely
because it is not a SPDR ETF), and auto.assign
is
TRUE, nothing will be assigned for that Symbol, but if
auto.assign
is FALSE, the returned list will have
NULL
for the element corresponding to that Symbol.
On non-Unix-like platforms, this function is called by
getHoldings
since this works cross-platform
but getHoldings.SPDR
does not.
Garrett See
getHoldings
,
getHoldings.SPDR
,
getHoldings.iShares
,
qmao:::getHoldings.iShares.AsOf
getHoldings.vaneck
,
getHoldings.powershares
1 2 3 4 5 6 | ## Not run:
getHoldings.selectSPDR("XLE")
XLE.h
getHoldings.selectSPDR(auto.assign=FALSE) #list of all of them
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.