bibentryExtra creates a "bibentryExtra" object. It has
the same arguments as bibentry, see its help page for
full details. The main difference is that for bibentryExtra, the
bibentry type, is not restricted to have values from the list of
standard Bibtex types (which is the case for bibtype).
bibentryExtra sets the "names" attribute to the keys of
the bib entries in it. However, further changes in the names and/or
the keys can make them different. If you want to keep the names always
consistent with the keys, set names(bee) <- NULL. This will
cause names to dynamically collect the keys when called.
as.bibentryExtra is a generic function for conversion of
objects to class "bibentryExtra", most notably from class
"bibentry".
Details on the subsetting methods are given below. The main thing that
needs to be pointed out is that the bracket operators take as first
argument the values of one or more keys, while for the dollar
operators the argument is the name of a field (e.g., journal).
This is convenient but can cause confusion, since usually $ and
[[ are (mostly) equivalent. This can be avoided by using
argument j, since in the (i,j) pair i is always a key
(or keys) and j the names of fields.
The subsetting methods aim to provide convenient access to components
of "bibentryExtra" objects. In comparison to the corresponding
methods for "bibenry" objects, the methods for
"bibentryExtra" provide some additional features. Most notably,
some of them include argument j, see the details below. If you
want similar access for "bibenry" objects, just convert them to
"bibentryExtra" using as.bibentryExtra.
It is convenient to think of the "bibentryExtra" as a ragged
array with ‘rows’ (the bib entries) and ‘columns’ (the
fields in the items). This is a peculiar ragged array, where each bib
item (row) may have a different collection of fields.
Additional functionality for the subscript operators that admit
argument j is provided for "bibentryExtra" objects. We
will say that argument j is missing completely if it is
missing and there is no placeholder for it in the call. For example
be[i] and be[i, drop = FALSE] are examples when j
is missing completely. On the other hand, be[i, ] and
be[i, , drop = FALSE] are examples when j is missing,
but not completely.
When j is completely missing, the subscript operations for
"bibentryExtra" objects work exactly as for bibentry
objects (the latter don't have methods that use j).
Alternatively, rather than use both i and j, one can set
i to be a list of length 2, whose two components stand for
i and j, respectively. The latter syntax can be used also
for the methods that don't have j as an argument
(but do have i).
The methods for the dollar operator
"$" extracts the specified field. "bibentryExtra"
inherits the "bibentry" method for "$". The result is
a list with one component for each bib entry.
Note that the result is a list for several reasons. First, some
fields may have more than one element. Second, some values are
likely to be NULL. Third, some fields may be compound
objects, e.g. ‘Author’, which is from class
"person". However, if the returned list has one element,
the enlosing list is removed (similarly to matrices with one row).
The "bibentryExtra" method for subset-assigment,
"$<-", assigns a new value to the specified field. In most
cases, value should be a list of the same length as x.
Otherwise, it will be wrapped in a list If it is not a list, the
result may be unexpected. For example, a character vector will
replace the specified field in all bib entries.
To change the values of the keys, specify field "key". Again,
remember that you get a list of all keys, unless there is only one
bib entry in x. So, value should be a list of the same
length.
The double bracket assignment method
The assignment version of "[[" does not have argument
j, so the two-element list form for i is used when
fields are needed, see above.
If value inherits from "bibentry" (in particular, it can
be a "bibentryExtra" object), then i must be a single
character string or a positive integer specifying the bibitem to
replace with value. Notice that the new item may have a
different key.
Otherwise, value should be a named list and i a list
of length 2.
In this case, i[[1]] should be a character string of a
positive integer identifyng the bib item on which replacement will
take place, while i[[2]] is a character vector specifying the
fields to replace. As a special case, i[[2]] can be the
character string "*", which specifies that all elements of
value should be used.
Usually value has names and these are interpreted as names of
fields. In this case, the fields specified by i[[2]] are
replaced by the corresponding fields in value.
If value has no names and i[[2]] is not equal to
"*" (see above), value must have the same length as
i[[2]] and its names are set to i[[2]].