generics: Access or Modify Content or Metadata

genericsR Documentation

Access or Modify Content or Metadata

Description

Access or modify the content or metadata of R objects.

Usage

content(x)
content(x) <- value
meta(x, tag = NULL, ...)
meta(x, tag = NULL, ...) <- value

Arguments

x

an R object.

value

a suitable R object.

tag

a character string or NULL (default), indicating to return the single metadata value for the given tag, or all metadata tag/value pairs.

...

arguments to be passed to or from methods.

Details

These are generic functions, with no default methods.

Often, classed R objects (e.g., those representing text documents in packages NLP and tm) contain information that can be grouped into “content”, metadata and other components, where content can be arbitrary, and metadata are collections of tag/value pairs represented as named or empty lists. The content() and meta() getters and setters aim at providing a consistent high-level interface to the respective information (abstracting from how classes internally represent the information).

Value

Methods for meta() should return a named or empty list of tag/value pairs if no tag is given (default), or the value for the given tag.

See Also

TextDocument for basic information on the text document infrastructure employed by package NLP.


NLP documentation built on Sept. 11, 2024, 6:59 p.m.

Related to generics in NLP...