get_issn_check_digit: Get ISSN check digit

View source: R/bibcodes.R

get_issn_check_digitR Documentation

Get ISSN check digit

Description

Takes a string representation of an ISSN and returns the check digit that satisfies the necessary condition. It can take a 8 digit string (and ignore the already extant check digit) or a 7 digit string (without the last digit)

Usage

get_issn_check_digit(x, allow.hyphens = FALSE, errors.as.nas = FALSE)

Arguments

x

A string of 7 or 8 digits

allow.hyphens

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

errors.as.nas

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

Value

Returns the character check digit that satifies the mod 11 condition. Returns "X" if 10. Returns NA if input is NA

Examples


get_issn_check_digit("03785955")

get_issn_check_digit("2434-561X", allow.hyphens=TRUE)

# nine digit string
get_issn_check_digit("0378595")

# vectorized
get_issn_check_digit(c("0378595", "2434561X", NA))


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