Learn R Programming

quantmod (version 0.4.26)

getDividends: Load Financial Dividend Data

Description

Download, or download and append stock dividend data from Yahoo! Finance.

Usage

getDividends(Symbol, 
             from = "1970-01-01",
             to = Sys.Date(), 
             env = parent.frame(), 
             src = "yahoo", 
             auto.assign = FALSE, 
             auto.update = FALSE, 
             verbose = FALSE,
             split.adjust = TRUE,
             ...,
             curl.options = list())

Value

If auto.assign is TRUE, the symbol will be written to the environment specified in env with a .div appended to the name.

If auto.update is TRUE and the object is of class xts, the dividends will be included as an attribute of the original object and be reassigned to the environment specified by env.

All other cases will return the dividend data as an xts object.

Arguments

Symbol

The Yahoo! stock symbol

from

date from in CCYY-MM-DD format

to

date to in CCYY-MM-DD format

env

where to create object

src

data source (only yahoo is valid at present)

auto.assign

should results be loaded to env

auto.update

automatically add dividend to data object

verbose

display status of retrieval

split.adjust

adjust dividends for splits (TRUE by default because that's what Yahoo returns)

...

currently unused

curl.options

options passed to curl::curl

Author

Jeffrey A. Ryan

Details

Eventually destined to be a wrapper function along the lines of getSymbols to different sources - this currently only support Yahoo data.

References

Yahoo! Finance: https://finance.yahoo.com

See Also

getSymbols

Examples

Run this code
if (FALSE) {
getSymbols("MSFT")
getDividends("MSFT")

getDividends(MSFT)
}

Run the code above in your browser using DataLab