Learn R Programming

tm (version 0.5-9.1)

meta: Meta Data Management

Description

Methods to access and modify meta data of documents, corpora, and repositories. In addition to tm's internal meta data structures, Simple Dublin Core meta data mappings are available.

Usage

## S3 method for class 'Corpus':
meta(x, tag, type = c("indexed", "corpus", "local"))
## S3 method for class 'TextDocument':
meta(x, tag, type = NULL)
## S3 method for class 'TextRepository':
meta(x, tag, type = NULL)
content_meta(x, tag) <- value
DublinCore(x, tag = NULL)

Arguments

x
Either a text document, a corpus, or a text repository.
tag
A character identifying the name of the meta datum.
type
A character specifying which meta data of a corpus should be considered.
value
Replacement value.

Details

In general this function can be used to display meta information but also to modify individual meta data: [object Object],[object Object],[object Object]

Simple Dublin Core meta data is only available locally at each document: [object Object]

content_meta is a convenience wrapper which calls Content if tag = "Content" and meta otherwise.

References

Dublin Core Metadata Initiative. http://dublincore.org/

Examples

Run this code
data("crude")
meta(crude[[1]])
DublinCore(crude[[1]])
meta(crude[[1]], tag = "Topics")
meta(crude[[1]], tag = "Comment") <- "A short comment."
meta(crude[[1]], tag = "Topics") <- NULL
DublinCore(crude[[1]], tag = "creator") <- "Ano Nymous"
DublinCore(crude[[1]], tag = "Format") <- "XML"
DublinCore(crude[[1]])
meta(crude[[1]])
meta(crude)
meta(crude, type = "corpus")
meta(crude, "labels") <- 21:40
meta(crude)

Run the code above in your browser using DataLab