Type: | Package |
Title: | Accessing FDIC Bank Data |
Version: | 0.1.1 |
Description: | Retrieves financial data from Federal Deposit Insurance Corporation (FDIC)-insured institutions and provides access to the FDIC data taxonomy. |
License: | MIT + file LICENSE |
URL: | https://github.com/visbanking/fdicdata, https://visbanking.com/opensource/ |
BugReports: | https://github.com/visbanking/fdicdata/issues |
Imports: | dplyr, httr, yaml |
Suggests: | testthat |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2024-09-12 00:22:05 UTC; ugurdar |
Author: | Ugur Dar [aut, cre], Brian Pillmore [aut, cph] |
Maintainer: | Ugur Dar <ugurdarr@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-09-12 16:10:06 UTC |
Convert bank identifier from CERT to IDRSSD
Description
This function takes a bank's CERT number as input and returns the corresponding IDRSSD number.
Usage
cert2idrssd(CERT)
Arguments
CERT |
An integer specifying the CERT number of the bank. |
Value
An integer specifying the IDRSSD number of the bank. Returns NULL if there is an error.
Examples
cert2idrssd(3850)
Taxonomy Data
Description
Extracts the taxonomy information for a given name
Usage
dataTaxonomy(name)
Arguments
name |
the name of the taxonomy file to extract. Available taxonomy names: "institution","location","history","summary","failure","financial". |
Value
a data frame containing the extracted taxonomy information
Get information on bank failures from FDIC data
Description
This function retrieves information on bank failures from the FDIC data API, using the specified fields and (optional) date range. If a date range is specified, only failures within that range will be included.
Usage
getFailures(fields, range = NULL, limit = 10000)
Arguments
fields |
a character vector specifying the fields to include in the output.
|
range |
a numeric vector of length 2 specifying the start and end dates (in YYYY format) for the date range to include. If not specified, all failures will be included. |
limit |
an integer specifying the maximum number of results to return. Defaults to 10,000. |
Value
a data frame containing the requested fields for each bank failure within the specified date range (if applicable).
Examples
df <- getFailures(c("CERT", "NAME", "FAILDATE", "CITY", "STATE"), range = c(2010, 2015))
head(df)
Get financial data for a given institution
Description
This function retrieves financial data for a given institution from the FDIC API.
Usage
getFinancials(IDRSSD_or_CERT, metrics, limit = 1, IDRSSD = TRUE, range = NULL)
Arguments
IDRSSD_or_CERT |
Numeric value indicating the IDRSSD or CERT number of the institution to retrieve data for. |
metrics |
Vector of metric names to retrieve financial data for. |
limit |
Number of records to retrieve. |
IDRSSD |
Boolean value indicating whether IDRSSD (True) or CERT number (False) is used. |
range |
Character vector contains start and end date for range. Open ended ranges can be expressed using a "*" |
Value
A dataframe containing the requested financial data.
Examples
getFinancials(37, metrics = c("ASSET", "DEP"),limit = 10, range = c("2015-01-01","*"))
getFinancials(37, metrics = c("ASSET", "DEP"),limit = 10, range = c("2015-01-01","2016-01-01"))
Get history of a bank by FDIC certificate number or name
Description
This function retrieves the history of a bank by either its FDIC certificate number or name. The user can specify which fields to include in the output.
Usage
getHistory(CERT_or_NAME = NULL, fields, CERT = TRUE, limit = 10000)
Arguments
CERT_or_NAME |
Either the FDIC certificate number or the name of the bank for which to retrieve history information. |
fields |
A character vector specifying the fields to include in the output. |
CERT |
A logical value indicating whether the value in CERT_or_NAME is a FDIC certificate number (default is TRUE). |
limit |
An integer indicating the maximum number of records to retrieve (default and max is 10000). |
Value
A data frame containing the requested history information for the specified bank.
Examples
getHistory(CERT_or_NAME = 3850, c("INSTNAME","CERT","PCITY","PSTALP","PZIP5"))
Retrieve institution data from FDIC API
Description
This function retrieves institution data from the FDIC API based on the specified parameters.
Usage
getInstitution(
name = NULL,
IDRSSD_or_CERT = NULL,
fields,
IDRSSD = TRUE,
limit = 10000
)
Arguments
name |
(optional) A character string to search for in the institution name. |
IDRSSD_or_CERT |
IDRSSD or CERT of bank |
fields |
A character vector of field names to retrieve from the API. |
IDRSSD |
Default:TRUE functions uses IDRSSD, to using CERT change it FALSE |
limit |
An integer specifying the maximum number of records to retrieve. Default is 10000. |
Value
A data frame containing the institution data.
References
For more information on the FDIC API, visit https://banks.data.fdic.gov/.
Examples
df <- getInstitution(name = "Bank of America", fields = c("NAME", "CITY", "STATE"))
Read FDIC Institution data set
Description
This function reads the FDIC Institution data set from a URL (FDIC listing of all institutions) and returns it as a data frame.
Usage
getInstitutionsAll()
Value
A data frame containing the FDIC Institution data set
Examples
#'\dontrun{dataInstitutions <- getInstitutionsAll()}
Get location information for a bank with a given CERT number
Description
This function retrieves location information for a bank with a given CERT number from the Federal Deposit Insurance Corporation (FDIC) database.
Usage
getLocation(CERT, fields = c("NAME", "CITY", "STNAME"), limit = 10000)
Arguments
CERT |
A character string specifying the CERT number of the bank to retrieve location information for. |
fields |
A character vector specifying the fields to include in the output. Default is c("NAME", "CITY", "STNAME"). |
limit |
An integer specifying the maximum number of locations to retrieve. Default is 10000.
|
Value
A data frame containing location information for the bank.
Examples
# Get location information for a bank with CERT number 3850
getLocation(3850)
# Get location information for a bank with CERT number 3850 and fields "NAME", "CITY", and "ZIP"
getLocation(3850, fields = c("NAME", "CITY", "ZIP"))
Get Summary Data from FDIC API
Description
This function retrieves summary data from the FDIC API based on given state names, a range of years, and specified fields. The returned data frame includes columns for state name, year, CB_SI, and the specified fields.
Usage
getSummary(states, range, fields, limit = 10000)
Arguments
states |
a character vector of state names to filter by |
range |
a numeric vector of length two representing the beginning and ending years to filter by. If NULL, no year filtering will occur. |
fields |
a character vector of field names to include in the output data frame |
limit |
an integer specifying the maximum number of rows to retrieve from the API |
Value
a data frame with summary data for the given states, years, and fields
Examples
df <- getSummary(c("West Virginia", "Delaware", "Alabama"), c(2015, 2016), c("ASSET", "INTINC"))
Get taxonomy file from FDIC website
Description
This function takes the name of the YAML file containing data taxonomy as an input and downloads it from the FDIC website, saving it to the local directory for later use.
Usage
getTaxonomy(taxonomy)
Arguments
taxonomy |
The name of the taxonomy file to download (one of "institution_properties.yaml", "location_properties.yaml", "history_properties.yaml", "summary_properties.yaml", "failure_properties.yaml", or "risview_properties.yaml") |
Convert bank identifier from IDRSSD to CERT
Description
This function takes a bank's IDRSSD number as input and returns the corresponding CERT number.
Usage
idrssd2cert(IDRSSD)
Arguments
IDRSSD |
An integer specifying the IDRSSD number of the bank. |
Value
An integer specifying the CERT number of the bank. Returns NULL if there is an error.
Examples
idrssd2cert(37)
Converts a vector of state names to a URL compatible format
Description
This function takes a vector of state names and converts it to a format that is compatible with URLs. The resulting string can be used as a filter for APIs or other web requests.
Usage
states2URL(vec)
Arguments
vec |
A vector of state names to be converted to URL-compatible format |
Value
A string containing the state names in URL-compatible format