Learn R Programming

libbib (version 1.6.4)

convert_to_isbn_13: Convert ISBN 10 to ISBN 13

Description

Takes a string representation of an ISBN 10 and converts it to an ISBN 13.

Usage

convert_to_isbn_13(x, skip.validity.check = FALSE, errors.as.nas = FALSE)

Value

Returns ISBN 13 as a string

Arguments

x

A string of 10 digits or 9 digits with terminal "X"

skip.validity.check

Skip the checking for whether the ISBN 10 is valid (default is FALSE)

errors.as.nas

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

Examples

Run this code

convert_to_isbn_13("012491540X")                # 9780124915404

# vectorized
convert_to_isbn_13(c("012491540X", "9004037810"))
# "9780124915404" "9789004037816"

Run the code above in your browser using DataLab