tests/test_getSplits.R

library(quantmod)

test.web.endpoints <- Sys.getenv("QUANTMOD_TEST_WEB_ENDPOINTS")

# Ensure getSplits() returns the expected ratio
if (nzchar(test.web.endpoints)) {
  aapl.spl <- as.numeric(getSplits("AAPL")["/2018"])
  expected <- c(0.5, 0.5, 0.5, 1/7)
  stopifnot(isTRUE(all.equal(aapl.spl, expected)))
}

Try the quantmod package in your browser

Any scripts or data that you put into this service are public.

quantmod documentation built on Aug. 22, 2023, 9:09 a.m.