normalize_isbn_13: Attempt to enforce validity and canonical form to ISBN 13
Description
Takes a string representation of an ISBN 13. Strips all non-digit
characters and checks if it is valid (whether the
check digit works out, etc). User can specify whether "aggressive"
measures should be taken to salvage the malformed ISBN 13 string.
Usage
normalize_isbn_13(x, aggressive = TRUE)
Value
Returns valid ISBN 13 if possible, NA if not
Arguments
x
A string
aggressive
A logical indicating whether aggressive measures
should be taken to try to get the "ISBN 13"
into a valid form. See "Details" for more info
(default is TRUE)
Details
If aggressive is TRUE, aggressive measures are taken to
try to salvage the malformed ISBN 13 string. If the ISBN 13, for example,
is more than 13 characters, this function will attempt to make a valid
ISBN 13 from the first 13 digits.