Files containing financial crisis data

Description

FinancialCrisisFiles in Ecdat is an object of class financialCrisisFiles created by the financialCrisisFiles function to describe files containing data on financial crises downloadable from http://www.reinhartandrogoff.com/data/browse-by-topic/topics/7/.

Usage

1
2
financialCrisisFiles(files=c("22_data.xls", "23_data.xls",
       "Varieties_Part_III.xls", "25_data.xls"), ...)

Arguments

files

character vector of file names

...

arguments to pass with file and sheet name to read.xls when reading a sheet of an MS Excel file. This is assumed to be the same for all sheets of all files. If this is not the case, the resulting financialCrisisFiles object will have to be edited manually before using it to read the data.

Details

Reinhart and Rogoff (http://www.reinhartandrogoff.com) provide numerous data sets analyzed in their book, "This Time Is Different: Eight Centuries of Financial Folly". Of interest here are data on financial crises of various types for 70 countries spanning the years 1800 - 2010, downloadable from http://www.reinhartandrogoff.com/data/browse-by-topic/topics/7/.

The function financialCrisisFiles produces a list of class financialCrisisFiles describing four different Excel files in very similar formats with one sheet per Country and a few extra descriptor sheets. The data object FinancialCrisisFiles is the default output of that function.

It does this in several steps:

1. Read the first sheet of each file

2. Extract the names of the Countries from that first sheet.

3. Elimiate any blank spaces in the names to convert, e.g., "Costa Rica" to "CostaRica".

4. Find the sheets corresponding to each of the compressed names.

5. Construct the output list.

Value

The function financialCrisisFiles returns a list of class financialCrisisFiles. This is a list with components carrying the names of files to be read. Each component is a list of optional arguments to pass to do.call(read.xls, ...) to read the sheet with name = name of that component.

The default value returned by financialCrisisFiles is the data object FinancialCrisisFiles. This corresponds to the files downloaded from http://www.reinhartandrogoff.com/data/browse-by-topic/topics/7/ in January 2013 (except for the fourth, which was not available there because of an error with the web site but instead was obtained directly from Prof. Reinhart).

Author(s)

Spencer Graves

Source

http://www.reinhartandrogoff.com

References

Carmen M. Reinhart and Kenneth S. Rogoff (2009) This Time Is Different: Eight Centuries of Financial Folly, Princeton U. Pr.

See Also

read.xls

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
Ecdat.demoFiles <- system.file('demoFiles', package='Ecdat')
Ecdat.xls <- dir(Ecdat.demoFiles, pattern='xls$',
                 full.names=TRUE)
if(require(gdata)){
  tst <- financialCrisisFiles(Ecdat.xls)
}
## Not run: 
# check
\dontshow{stopifnot(}
all.equal(tst, data(FinancialCrisisFiles))
\dontrun{)}

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.