is_valid_lc_call: Check if LC Call Number is valid

View source: R/call-numbers-and-subject.R

is_valid_lc_callR Documentation

Check if LC Call Number is valid

Description

Takes a string representation of a Library of Congress call number and returns either TRUE or FALSE based on whether or not the input fits the canonical LC Call Number pattern

Usage

is_valid_lc_call(x, allow.bare = FALSE)

Arguments

x

A Library of Congress call number (string)

allow.bare

A logical indicating whether an LC Call with only the letters should be considered valid (default is FALSE)

Value

Returns either TRUE or FALSE based on whether the call number is valid

Examples


is_valid_lc_call("Q172.5.E77")
# TRUE
is_valid_lc_call("AF172.5.E77")
# FALSE

# vectorized
is_valid_lc_call(c("Q 172.5", "AF172", "PR6023.A93"))
# TRUE FALSE TRUE


libbib documentation built on Nov. 10, 2022, 6:16 p.m.