Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is_valid_ISIN

Validate Security Identification Numbers


Description

Check whether a given ISIN is valid.

Usage

is_valid_ISIN(isin)
is_valid_SEDOL(SEDOL, NA.FALSE = FALSE)

Arguments

isin

a character vector

SEDOL

a character vector

NA.FALSE

logical

Details

Checks a character vector of ISINs and SEDOLs. The function returns TRUE if the ISIN is valid; else FALSE.

International Securities Identification Numbers (ISINs): The test procedure in ISO 6166 does not differentiate between cases. Thus, ISINs are transformed to uppercase before being tested.

Value

A named logical vector. For is_valid_SEDOL, a character vector is attached as an attribute note.

Author(s)

Enrico Schumann

References

Examples

isin <- c("US0378331005", "AU0000XVGZA3",
          "DE000A0C3743", "not_an_isin")
is_valid_ISIN(isin)

is_valid_ISIN(c("US0378331005",
                "us0378331005")) ## case is ignored


SEDOL <- c("0263494", "B1F3M59", "0263491", "A", NA)
is_valid_SEDOL(SEDOL)
## 0263494 B1F3M59 0263491       A    <NA>
##    TRUE    TRUE   FALSE   FALSE      NA

is_valid_SEDOL(SEDOL, NA.FALSE = TRUE)
## 0263494 B1F3M59 0263491       A    <NA>
##    TRUE    TRUE   FALSE   FALSE   FALSE

PMwR

Portfolio Management with R

v0.16-0
GPL-3
Authors
Enrico Schumann [aut, cre] (<https://orcid.org/0000-0001-7601-6576>)
Initial release
2021-01-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.