MarcRecord | R Documentation |
This is the base class used to interact with marc records
This class provides functions for reading marc records from online or disk sources and to retrieve information from them.
Currently only MarcXML files are supported.
controlfields
The control fields (00X) of the record
datafields
The data fields (>= 010) of the record
get_fields()
Retrieve data fields from this record while applying optional filtering.
MarcRecord$get_fields(tag, ind_1, ind_2, simplify = FALSE)
tag
Optional. Tag(s) for which to filter the record, must be a vector of size >= 1 and type numeric or character
ind_1
Optional. First indicator(s) for which to filter the record, must be a vector of size >= 1 and type character
ind_2
Optional. Second indicator(s) for which to filter the record, must be a vector of size >= 1 and type character
simplify
If set to true the data fields will be coerced in to a data frame before returning, otherwise a list of MarcDatafield
will be returned
The requested data as either a data frame or a list, depending on simplify
record <- MarcRecord$new() record$read_record("http://d-nb.info/gnd/11897792X/about/marcxml") # Get fields with optional filtering record$get_fields(tag = c(548, 550), simplify = TRUE)
read_record()
Read a marc record from disk or an online source. Currently only marcxml is supported.
MarcRecord$read_record(path)
path
Path or URL of the data to read. Must be a character vector of size 1.
record <- MarcRecord$new() record$read_record("http://d-nb.info/gnd/11897792X/about/marcxml") record
print()
Print method for a marc record
MarcRecord$print(...)
clone()
The objects of this class are cloneable with this method.
MarcRecord$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------
## Method `MarcRecord$get_fields`
## ------------------------------------------------
record <- MarcRecord$new()
record$read_record("http://d-nb.info/gnd/11897792X/about/marcxml")
# Get fields with optional filtering
record$get_fields(tag = c(548, 550), simplify = TRUE)
## ------------------------------------------------
## Method `MarcRecord$read_record`
## ------------------------------------------------
record <- MarcRecord$new()
record$read_record("http://d-nb.info/gnd/11897792X/about/marcxml")
record
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.