Title: | Accessing FDIC Bank Data |
---|---|
Description: | A system provides a set of functions for working with data from the Federal Deposit Insurance Corporation (FDIC), including retrieving financial data for FDIC-insured institutions and accessing the data taxonomy. |
Authors: | Ugur Dar [aut, cre], Brian Pillmore [aut, cph] |
Maintainer: | Ugur Dar <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-12 05:42:08 UTC |
Source: | https://github.com/visbanking/fdicdata |
This function takes a bank's CERT number as input and returns the corresponding IDRSSD number.
cert2idrssd(CERT)
cert2idrssd(CERT)
CERT |
An integer specifying the CERT number of the bank. |
An integer specifying the IDRSSD number of the bank. Returns NULL if there is an error.
cert2idrssd(3850)
cert2idrssd(3850)
Extracts the taxonomy information for a given name
dataTaxonomy(name)
dataTaxonomy(name)
name |
the name of the taxonomy file to extract. Available taxonomy names: "institution","location","history","summary","failure","financial". |
a data frame containing the extracted taxonomy information
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.
getFailures(fields, range = NULL, limit = 10000)
getFailures(fields, range = NULL, limit = 10000)
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. |
a data frame containing the requested fields for each bank failure within the specified date range (if applicable).
df <- getFailures(c("CERT", "NAME", "FAILDATE", "CITY", "STATE"), range = c(2010, 2015)) head(df)
df <- getFailures(c("CERT", "NAME", "FAILDATE", "CITY", "STATE"), range = c(2010, 2015)) head(df)
This function retrieves financial data for a given institution from the FDIC API.
getFinancials(IDRSSD_or_CERT, metrics, limit = 1, IDRSSD = TRUE, range = NULL)
getFinancials(IDRSSD_or_CERT, metrics, limit = 1, IDRSSD = TRUE, range = NULL)
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 "*" |
A dataframe containing the requested financial data.
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"))
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"))
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.
getHistory(CERT_or_NAME = NULL, fields, CERT = TRUE, limit = 10000)
getHistory(CERT_or_NAME = NULL, fields, CERT = TRUE, limit = 10000)
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). |
A data frame containing the requested history information for the specified bank.
getHistory(CERT_or_NAME = 3850, c("INSTNAME","CERT","PCITY","PSTALP","PZIP5"))
getHistory(CERT_or_NAME = 3850, c("INSTNAME","CERT","PCITY","PSTALP","PZIP5"))
This function retrieves institution data from the FDIC API based on the specified parameters.
getInstitution( name = NULL, IDRSSD_or_CERT = NULL, fields, IDRSSD = TRUE, limit = 10000 )
getInstitution( name = NULL, IDRSSD_or_CERT = NULL, fields, IDRSSD = TRUE, limit = 10000 )
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. |
A data frame containing the institution data.
For more information on the FDIC API, visit https://banks.data.fdic.gov/.
df <- getInstitution(name = "Bank of America", fields = c("NAME", "CITY", "STATE"))
df <- getInstitution(name = "Bank of America", fields = c("NAME", "CITY", "STATE"))
This function reads the FDIC Institution data set from a URL (FDIC listing of all institutions) and returns it as a data frame.
getInstitutionsAll()
getInstitutionsAll()
A data frame containing the FDIC Institution data set
#'\dontrun{dataInstitutions <- getInstitutionsAll()}
#'\dontrun{dataInstitutions <- getInstitutionsAll()}
This function retrieves location information for a bank with a given CERT number from the Federal Deposit Insurance Corporation (FDIC) database.
getLocation(CERT, fields = c("NAME", "CITY", "STNAME"), limit = 10000)
getLocation(CERT, fields = c("NAME", "CITY", "STNAME"), limit = 10000)
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.
|
A data frame containing location information for the bank.
# 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 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"))
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.
getSummary(states, range, fields, limit = 10000)
getSummary(states, range, fields, limit = 10000)
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 |
a data frame with summary data for the given states, years, and fields
df <- getSummary(c("West Virginia", "Delaware", "Alabama"), c(2015, 2016), c("ASSET", "INTINC"))
df <- getSummary(c("West Virginia", "Delaware", "Alabama"), c(2015, 2016), c("ASSET", "INTINC"))
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.
getTaxonomy(taxonomy)
getTaxonomy(taxonomy)
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") |
This function takes a bank's IDRSSD number as input and returns the corresponding CERT number.
idrssd2cert(IDRSSD)
idrssd2cert(IDRSSD)
IDRSSD |
An integer specifying the IDRSSD number of the bank. |
An integer specifying the CERT number of the bank. Returns NULL if there is an error.
idrssd2cert(37)
idrssd2cert(37)
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.
states2URL(vec)
states2URL(vec)
vec |
A vector of state names to be converted to URL-compatible format |
A string containing the state names in URL-compatible format