50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

libbib (version 1.6.4)

is_valid_lc_call: 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)

Value

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

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)

Examples

Run this code

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

Run the code above in your browser using DataLab