N1_field: Extract finer-grained metadata from the note field

Description Usage Arguments Details Value Examples

Description

In the MLA bibliography, the N1 (note) field contains further metadata which is general consistently identified and can be programmatically extracted. Examples include the Accession Number, Publication Type, DOI, and Peer Reviewed fields.

Usage

1
N1_field(x, field)

Arguments

x

character vector

field

name of field to extract (without colon). Case sensitive.

Details

Fields are reliably delimited only by a terminating period, and there is sometimes a missing period at the end of a field, e.g. in MLAIB acc nos. 1998070296, 1979107484, 1979202534. If the field data contains a period this is a problem, but the only case in which I know this to happen is in DOI fields. This is treated as a special case.

Value

character vector of extracted values. Validate carefully. Missing values are represented as NA.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
b <- read_ris("bib.ris") %>%
    spread_ris()

# Extract peer reviewing flag
# N.B. This information is very incomplete in the MLAIB
b %>%
    mutate(peer=N1_field(N1, "Peer Reviewed") == "Yes")

# Extract publication type
# This is not just a recoding of the RIS field TY. Cross-tabulate.
b %>%
    mutate(pubtype=N1_field(N1, "Publication Type")) %>%
    count(TY, pubtype)

## End(Not run)

agoldst/mlaibr documentation built on May 10, 2019, 7:34 a.m.