Learn R Programming

NMOF (version 2.10-0)

Shiller: Download Robert Shiller's Data

Description

Download the data provided by Robert Shiller and transform them into a data frame.

Usage

Shiller(dest.dir,
        url = NULL)

Value

a data.frame:

Date

end of month

Price

numeric

Dividend

numeric

Earnings

numeric

CPI

numeric

Long Rate

numeric

Real Price

numeric

Real Dividend

numeric

Real Earnings

numeric

CAPE

numeric

Arguments

dest.dir

character: a path to a directory

url

the data URL

Author

Enrico Schumann

Details

The function downloads US stock-market data provided by Robert Shiller which he used in his book ‘Irrational Exhuberance’. Since the data are provided in Excel format, package readxl is required.

The downloaded Excel gets a date prefix (today in format YYYYMMDD) and is stored in directory dest.dir. Before any download is attempted, the function checks whether a file with today's prefix exist in dest.dir; if yes, the file is used.

References

Gilli, M., Maringer, D. and Schumann, E. (2019) Numerical Methods and Optimization in Finance. 2nd edition. Elsevier. tools:::Rd_expr_doi("10.1016/C2017-0-01621-X")

Schumann, E. (2023) Financial Optimisation with R (NMOF Manual). https://enricoschumann.net/NMOF.htm#NMOFmanual

Shiller, R.J. (2015) Irrational Exhuberance. Princeton University Press. 3rd edition.

See Also

French

Examples

Run this code
if (FALSE) {
archive.dir <- "~/Downloads/Shiller"
if (!dir.exists(archive.dir))
    dir.create(archive.dir)
Shiller(archive.dir)
}

Run the code above in your browser using DataLab