unlist.BibEntry: Flatten and unflatten BibEntry objects

View source: R/unlist.R

RelistBibEntryR Documentation

Flatten and unflatten BibEntry objects

Description

RelistBibEntry unflattens a BibEntry object that has been flattened with unlist.

unlist flattens a BibEntry object to a single list where every field (including bibtype and key) of every entry is a separate element in the list.

Usage

RelistBibEntry(flesh, skeleton = NULL)

## S3 method for class 'BibEntry'
unlist(x, recursive = FALSE, use.names = TRUE)

Arguments

flesh

list; an unlisted BibEntry object

skeleton

currently ignored

x

a BibEntry object to flatten

recursive

ignored.

use.names

ignored.

Details

RelistBibEntry is only intended for use with unlisted BibEntry objects.

Value

RelistBibEntry - an object of class BibEntry

For unlist, a list with bib entries collapsed into a single list.

Note

The names of the list elements from an unlisted BibEntry object will not be unique. To do this see make.unique.

See Also

as.BibEntry

Examples

bib <- list(c(bibtype = "article", key = "mclean2014a", title = "My New Article",
  author = "Mathew W. McLean", journaltitle = "The Journal", date = "2014-01"),
  c(bibtype = "article", key = "mclean2014b", title = "My Newer Article",
  author = "Mathew W. McLean", journaltitle = "The Journal", date = "2014-02"))
bib <- as.BibEntry(bib)
unlist(bib)
RelistBibEntry(unlist(bib))

ropensci/RefManageR documentation built on Sept. 2, 2023, 9:32 p.m.