validate_cusip: Checks for CUSIP validity.

View source: R/validate_cusip.R

validate_cusipR Documentation

Checks for CUSIP validity.

Description

Using the CUSIP Global services methodology, this function checks the validity of CUSIPs. The check relies on the Modulus 10 Double Add Double algorithm. It does not query to check the assignment of any identifier only its compositional validity. This is useful for checking hand or OCR generated input. All non-9 digit inputs will return as FALSE (i.e. invalid cusip).

Usage

validate_cusip(cusips)

Arguments

cusips

A character vector of presumed CUSIP identifiers

Value

Returns a logical vector of CUSIP validity

Examples


# check vector of CUSIPs for validity
x <- c("037833100", "0378331O0")
validate_cusip(x)


p-will-b/creditor documentation built on March 28, 2023, 6:46 p.m.