check_isbn_13_check_digit: Check the check digit of an ISBN 13

View source: R/bibcodes.R

check_isbn_13_check_digitR Documentation

Check the check digit of an ISBN 13

Description

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

Usage

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

Arguments

x

A string of 13 digits

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 TRUE)

Value

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

Examples


check_isbn_13_check_digit("9780306406157")          # TRUE
check_isbn_13_check_digit("978-0-306-40615-7")      # TRUE

# vectorized
check_isbn_13_check_digit(c("978-0-306-40615-7", "9783161484103"))  # TRUE FALSE


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