Learn R Programming

RefManageR (version 1.4.0)

head.BibEntry: Return the first or last part of a BibEntry object

Description

Prints the first or last entries of a BibEntry object (via message) and returns them invisibly (via invisible).

Usage

# S3 method for BibEntry
head(x, n = 6L, suppress.messages = TRUE, ...)

# S3 method for BibEntry tail(x, n = 6L, suppress.messages = TRUE, ...)

Value

an object of class BibEntry.

Arguments

x

an object of class BibEntry.

n

a single integer. If positive, size for the resulting object: number of elements for a vector (including lists), rows for a matrix or data frame or lines for a function. If negative, all but the n last/first number of elements of x.

suppress.messages

boolean; should the head/tail entries be printed via message?

...

arguments to be passed to or from other methods.

Details

If suppress.messages is FALSE, the head/tail entries are output to the console along with some additional formatting for the ‘bibtype’ and ‘key’, in addition to invisibly returning the entries.

Examples

Run this code
if (requireNamespace("bibtex")) {
    file <- system.file("Bib", "biblatexExamples.bib", package = "RefManageR")
    BibOptions(check.entries = FALSE)
    bib <- ReadBib(file)
    tail(bib, 2, suppress.messages = FALSE)
    bib <- head(bib, 1, suppress.messages = TRUE)
}

Run the code above in your browser using DataLab