check_issn_check_digit: Check the check digit of an ISSN

View source: R/bibcodes.R

check_issn_check_digitR Documentation

Check the check digit of an ISSN

Description

Takes a string representation of an ISSN and verifies that check digit checks out

Usage

check_issn_check_digit(x, allow.hyphens = TRUE, errors.as.false = FALSE)

Arguments

x

A string of 8 digits or 7 digits with terminal "X"

allow.hyphens

A logical indicating whether the hyphen separator should be allowed (default is TRUE)

errors.as.false

return false if error instead of throwing error (default is FALSE)

Value

Returns TRUE if check passes, FALSE if not, and NA if NA

Examples


check_issn_check_digit("2434561X")   # TRUE
check_issn_check_digit("2434-561X")  # TRUE

# vectorized
check_issn_check_digit(c("03785955", "2434561X", NA))  # TRUE TRUE NA
check_issn_check_digit(c("0378-5955", "2434-561X", NA))
# TRUE TRUE NA


libbib documentation built on Nov. 10, 2022, 6:16 p.m.