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-10-27 04:19:02 UTC |
Source: | https://github.com/uribo/isbn |
Validate ISBN
is_valid_isbn(x, prefix = NULL)
is_valid_isbn(x, prefix = NULL)
x |
ISBN number. It can be a string or a number. |
prefix |
ISBN prefix, such as "978" or "979". Default is NULL. |
TRUE if the ISBN is valid, FALSE otherwise.
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")
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
isbn_convert10to13(x, .prefix = "978") isbn_convert13to10(x) normalize(x)
isbn_convert10to13(x, .prefix = "978") isbn_convert13to10(x) normalize(x)
x |
ISBN number. It can be a string or a number. |
.prefix |
ISBN prefix, such as "978" or "979". |
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"))
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
risbn(n = 1, group = "0", simplify = TRUE)
risbn(n = 1, group = "0", simplify = TRUE)
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. |
risbn(3, "0") risbn(2, c("0", "4"), simplify = FALSE)
risbn(3, "0") risbn(2, c("0", "4"), simplify = FALSE)