View source: R/is_valid_ISIN.R
is_valid_ISIN | R Documentation |
Check whether a given ISIN or SEDOL is valid.
is_valid_ISIN(isin)
is_valid_SEDOL(SEDOL, NA.FALSE = FALSE)
isin |
a character vector |
SEDOL |
a character vector |
NA.FALSE |
logical |
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.
A named logical vector. For is_valid_SEDOL
, a character vector
is attached as an attribute note
.
Enrico Schumann
https://en.wikipedia.org/wiki/ISO_6166
https://en.wikipedia.org/wiki/SEDOL
https://anna-web.org/identifiers/
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.