Package 'isbn'

Title: Convert, Validate and Hyphenate for ISBN
Description: More about what it does (maybe more than one line) Use four spaces when indenting paragraphs within the Description.
Authors: Shinya Uryu [aut, cre]
Maintainer: Shinya Uryu <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2024-11-26 04:06:57 UTC
Source: https://github.com/uribo/isbn

Help Index


Validate ISBN

Description

Validate ISBN

Usage

is_valid_isbn(x, prefix = NULL)

Arguments

x

ISBN number. It can be a string or a number.

prefix

ISBN prefix, such as "978" or "979". Default is NULL.

Value

TRUE if the ISBN is valid, FALSE otherwise.

Examples

is_valid_isbn("978-4-274-06800-3")
is_valid_isbn(1492097402, "978")
is_valid_isbn("412345674X")
is_valid_isbn("4274068003", "978")
# Failed examples
is_valid_isbn("978_427x4x06800x3")

Convert ISBN-10 and ISBN-13

Description

Convert ISBN-10 and ISBN-13

Usage

isbn_convert10to13(x, .prefix = "978")

isbn_convert13to10(x)

normalize(x)

Arguments

x

ISBN number. It can be a string or a number.

.prefix

ISBN prefix, such as "978" or "979".

Examples

isbn_convert13to10("978-4-06-516404-4")
isbn_convert13to10(c("978-4-06-516404-4", "9784863542167"))

isbn_convert10to13(x = c("412345674X", "4022518286"))

normalize(c("978-4-06-516404-4", "4871884430"))

Generate random ISBN numbers

Description

Generate random ISBN numbers

Usage

risbn(n = 1, group = "0", simplify = TRUE)

Arguments

n

Number of ISBN numbers to generate

group

ISBN group number, must be a string of 1 to 5 digits.

simplify

Logical, if TRUE, the result is simplified to a vector.

Examples

risbn(3, "0")
risbn(2, c("0", "4"), simplify = FALSE)