Nothing
# instruments
# stock creates stock
# stock is created and assigned in .instrument environment and the primary_id
# of the stock is returned.
expect_inherits(stock("AAA", currency("USD")), "character")
expect_inherits(getInstrument("AAA", type="stock"), "stock")
expect_true(is.null(names(stock(c("AAA", "BBB"), "USD"))))
# stock not assigned
# overwrite=FALSE is ignored because assign_i=FALSE
s <- c("BBB", "AAA")
ilist <- stock(s, "USD", assign_i=FALSE, overwrite=FALSE)
expect_true(is.list(ilist)) # tinytest check for type
expect_true(all(vapply(ilist, inherits, FUN.VALUE=TRUE, "stock")))
expect_identical(names(ilist), s)
# stock overwrite throws errors
expect_error(stock("AAA", "USD", overwrite=FALSE))
rm_stocks("BBB")
expect_error(stock(c("BBB", "AAA"), "USD", overwrite=FALSE))
# Make sure it didn't define BBB
expect_true(!getInstrument("BBB", type="stock", silent=TRUE))
# loadInstruments from list
rm_instruments(keep.currencies=FALSE)
stock(c("A", "B"), currency("USD")) # put some stuff in the .instrument env
L <- stock(c("DD", "EE"), "USD", assign_i=FALSE)
expect_true(!is.instrument.name("DD"))
loadInstruments(L)
expect_true(is.instrument.name("DD"))
expect_true(is.instrument.name("A"))
reloadInstruments(L)
expect_true(!is.instrument.name("A"))
expect_true(is.instrument.name("DD"))
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.