Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/getHoldings.SPDR.R
On Non-Unix-alike platforms, this will call
getHoldings.selectSPDR
which is platform
independent (but only works for the 9 Select Sector
SPDRs).
1 2 | getHoldings.SPDR(Symbols, env = .GlobalEnv,
auto.assign = TRUE)
|
Symbols |
character vector of SPDR ETF symbols.
Presently, if no |
env |
where to store holdings (only used if
|
auto.assign |
should the results be assigned in
|
This function is usually called by
getHoldings
, but it can also be called
directly
As of July 8, 2012, the CSVs provided by spdrs.com no
longer include a Ticker column which means that the
returned holdings
object will no longer have the
ticker symbols of the holdings as rownames.
Beware that the CSV that spdrs.com provides for some ETFs (e.g. DIA) has the same number of shares for all holdings (which is incorrect).
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.
this uses download.file
with method="curl"
which is not supported on Windows.
Garrett See
getHoldings
,
getHoldings.iShares
,
getHoldings.selectSPDR
,
getHoldings.vaneck
,
getHoldings.powershares
,
getHoldings.GlobalX
,
getHoldings.FirstTrust
1 2 3 4 5 | ## Not run:
getHoldings.SPDR("SPY")
SPY.h
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.