get_bank_ids: Get bank IDs for target banks

View source: R/get_bank_ids.R

get_bank_idsR Documentation

Get bank IDs for target banks

Description

Get bank IDs for target banks

Usage

get_bank_ids(
  bank_names,
  bank_meta_data,
  entity_type = "FHD",
  most_recent = TRUE
)

Arguments

bank_names

The names of the banks to be selected from the bank_meta_data

bank_meta_data

a data.frame with columns for ID_RSSID, Entity_Type, Name

entity_type

The target entity type (Default: "FHD"). NA indicates the entity_type is not used.

most_recent

if TRUE then select the most recent entry.

Value

If most_recent is TRUE then a vector of one ID for each bank_name. Otherwise, multiple IDs may be returned in a list

Examples

bank_meta_data <- data.frame(ID_RSSID = c(10, 20, 30),
  Entity_Type = rep("FHD", 3),
  Name = c("HUNTINGTON BANCSHARES INCORPORATED", "KEYCORP", "PNC BANK CORP"))
targets <- c("HUNTINGTON BANCSHARES INCORPORATED", "KEYCORP", "PNC BANK CORP")
target_ids <- get_bank_ids(targets, bank_meta_data)
all(target_ids == c(10, 20, 30))

bertcarnell/fry9c documentation built on April 18, 2022, 10:05 p.m.