View source: R/find.instrument.R
| find.instrument | R Documentation |
Uses regular expression matching to find instruments
find.instrument(
text,
where = "anywhere",
Symbols = ls_instruments(),
ignore.case = TRUE,
exclude = NULL,
...
)
text |
character string containing a regular expression. This is used
by |
where |
if “anywhere” all levels/attributes of the instruments
will be searched. Otherwise, |
Symbols |
the character ids of instruments to be searched. All are are searched by default. |
ignore.case |
passed to |
exclude |
character vector of names of levels/attributes that should not be searched. |
... |
other arguments to pass through to |
character vector of primary_ids of instruments that contain the
sought after text.
Garrett See
buildHierarchy, instrument.table,
regex
backup_file <- tempfile(fileext = ".RData")
saveInstruments(backup_file)
tryCatch(
{
rm_instruments(keep.currencies = FALSE)
currency(c("USD", "EUR"))
stock("SPY", "USD", description = "S&P 500 ETF")
stock("DIA", "USD", description = "DJIA ETF")
stock(
c("AA", "AXP", "BA", "BAC", "CAT"),
"USD",
members.of = "DJIA"
)
stock("BMW", "EUR")
find.instrument("ETF")
find.instrument("DJIA")
find.instrument("DJIA", where = "members.of")
find.instrument("USD")
find.instrument("EUR", Symbols = ls_stocks())
},
finally = {
reloadInstruments(backup_file)
unlink(backup_file)
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.