As an object is printed, knitr will collect metadata about it (if
available). After knitting is done, all the metadata is accessible via this
function. You can manually add metadata to the knitr session via
knit_meta_add()
.
knit_meta(class = NULL, clean = TRUE)knit_meta_add(meta, label = "")
Optionally return only metadata entries that inherit from the
specified class. The default, NULL
, returns all entries.
Whether to clean the collected metadata. By default, the
metadata stored in knitr is cleaned up once retrieved, because we may
not want the metadata to be passed to the next knit()
call; to be
defensive (i.e. not to have carryover metadata), you can call
knit_meta()
before knit()
.
A metadata object to be added to the session.
A chunk label to indicate which chunk the metadata belongs to.
knit_meta()
returns the matched metadata specified by
class
; knit_meta_add()
returns all current metadata.