marc_008_get_info: Get info from MARC control field 008

View source: R/marc-field-deconstruction.R

marc_008_get_infoR Documentation

Get info from MARC control field 008

Description

Takes one or more MARC 008 fields (string/strings) and returns a data.table containing the publication date, publication place code, and language code.

Usage

marc_008_get_info(
  x,
  original.pub.date = FALSE,
  include.questionable.dates = FALSE
)

Arguments

x

A string (or vector of strings) of LCCNs

original.pub.date

If TRUE and if applicable, return the original publication date, not the re-issue publication date. (Default is FALSE)

include.questionable.dates

A logical indicating whether "questionable" dates should be replaced with NA. Questionable dates are when the "type of date" in character position 06 is "q". (default is FALSE)

Details

If any date element is "unknown" (contains a "u"), the returned date is NA. The returned date is always an integer.

Value

A data.table

Examples


# reissue publication date
marc_008_get_info("950622r19701880ru            000 0 rus d")
#     pub_date pub_place_code lang_code
#        <int>         <char>    <char>
#  1:     1970             ru       rus

# The Brothers Karamazov (1970 reissue but original publication date)
marc_008_get_info("950622r19701880ru            000 0 rus d",
                  original.pub.date=TRUE)
#    pub_date pub_place_code lang_code
#       <int>         <char>    <char>
# 1:     1880             ru       rus

# vectorized
marc_008_get_info(c("101106s1992    gr            000 1 gre d", NA,
                    "180528s2017    ag            000 j spa d"))
#      pub_date pub_place_code lang_code
#         <int>         <char>    <char>
#   1:     1992             gr       gre
#   2:       NA           <NA>      <NA>
#   3:     2017             ag       spa


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