Package 'fdicdata'

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

Help Index


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.

NAME

The name of the failed bank

CERT

The FDIC certificate number of the failed bank

FIN

The failed bank's unique financial institution identifier

CITYST

The city and state where the failed bank was located

FAILDATE

The date of the bank failure

FAILYR

The year of the bank failure

SAVR

Whether the failed bank was a savings and loan association

RESTYPE

The type of failed institution

RESTYPE1

A more specific classification of the failed institution

CHCLASS1

The bank's charter class

QBFDEP

The amount of deposits held by the bank at the time of failure

QBFASSET

The total assets held by the bank at the time of failure

COST

The estimated cost to the FDIC of the bank's failure

PSTALP

The FDIC's estimated percentage of insured deposits paid to depositors

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.

ZIP

The ZIP code for the location.

UNINUM

A unique identifier for the location.

STNAME

The name of the state where the location is located.

STCNTY

The name of the county where the location is located.

STALP

The two-letter abbreviation for the state where the location is located.

SERVTYPE_DESC

A description of the type of service provided at the location.

SERVTYPE

A code indicating the type of service provided at the location.

RUNDATE

The date the location information was last updated.

OFFNUM

The number of the office associated with the location.

OFFNAME

The name of the office associated with the location.

NAME

The name of the financial institution associated with the location.

MAINOFF

A flag indicating whether the location is the main office for the financial institution.

MDI_STATUS_DESC

A description of the regulatory status of the financial institution associated with the location.

MDI_STATUS_CODE

A code indicating the regulatory status of the financial institution associated with the location.

LONGITUDE

The longitude of the location.

LATITUDE

The latitude of the location.

FI_UNINUM

A unique identifier for the financial institution associated with the location.

ESTYMD

The date the financial institution associated with the location was established.

CSA_NO

The Core Based Statistical Area (CBSA) number for the location.

CSA_FLG

A flag indicating whether the location is part of a CBSA.

CSA

The name of the CBSA associated with the location.

COUNTY

The name of the county associated with the location.

CITY

The name of the city associated with the location.

CERT

The certificate number of the financial institution associated with the location.

CBSA_NO

The CBSA number for the location.

CBSA_MICRO_FLG

A flag indicating whether the CBSA associated with the location is a micro area.

CBSA_METRO_NAME

The name of the metropolitan area associated with the location.

CBSA_METRO_FLG

A flag indicating whether the location is part of a metropolitan area.

CBSA_METRO

The code for the metropolitan area associated with the location.

CBSA_DIV_NO

The CBSA division number for the location.

CBSA_DIV_FLG

A flag indicating whether the location is part of a CBSA division.

CBSA_DIV

The name of the CBSA division associated with the location.

CBSA

The code for the CBSA associated with the location.

BKCLASS

The bank class associated with the location.

ADDRESS

Address of the bank.

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