-
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Yahoo dividends are no longer split adjusted
Yahoo Finance used to return split-adjusted dividends. Now they return the raw dividend data. Update getDividends() to adjust the raw dividend data for splits by default, and do nothing if 'split.adjust = FALSE'. Thanks to Douglas Barnard for the detailed report! Fixes #253.
- Loading branch information
1 parent
3451f11
commit 8321ee8
Showing
2 changed files
with
10 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
library(quantmod) | ||
|
||
# split-adjusted by default | ||
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)))) |