get_isbn_10_check_digit("012491540X")
get_isbn_10_check_digit("0-124-91540-X", allow.hyphens=TRUE)
# nine digit string
get_isbn_10_check_digit("900403781")
get_isbn_10_check_digit("onetwothre", errors.as.nas=TRUE) # NA
# vectorized
get_isbn_10_check_digit(c("012491540X", "9004037810", "900403781"))
Run the code above in your browser using DataLab