check_issn: Check ISSN validity

View source: R/check_issn.R

check_issnR Documentation

Check ISSN validity

Description

Calculate the check digit of ISSNs and compare to current digit

Usage

check_issn(x)

Arguments

x

A character vector of ISSNs to check

Details

Calculates the check digit of one or more input fundamentally-formatted ISSNs. Fundamentally formatted refers to the input after whitespace-stripping, and only keeping alphanumeric values Additionally, the final character checksum is performed on a case-normalized basis.

This means that input ISSNs can be quite ill-formatted and still be evaluated for validity, and test as valid. See example.

Value

A list of length 2 containing a data.frame of results and any ISSNs that could not be checked due to invalid format; if no inputs are invalid, then NULL for the latter.

Examples

# Note that dashes and whitespaces are
test_issns <- c("10543589", "00657743", "0091679X",
                "1054-3589", "0065-7743", "0091-679X",
                "1054--3589", " 0065-7743", "0091--679x-",
                "0091679xx", "0091x79x", "0091X679")
check_issn(test_issns)

slin30/wzMisc documentation built on Jan. 27, 2023, 1 a.m.