tests/test_getDividends.R

library(quantmod)

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

# split-adjusted by default
#if (nzchar(test.web.endpoints)) {
if (FALSE) {
  cf.div.adj <- as.numeric(getDividends("CF")["2015"])
  stopifnot(isTRUE(all.equal(cf.div.adj, rep(0.3, 4))))
  cf.div.raw <- as.numeric(getDividends("CF", split.adjust = FALSE)["2015"])
  stopifnot(isTRUE(all.equal(cf.div.raw, c(1.5, 1.5, 0.3, 0.3))))
}

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.