set_corpus_variables: set_corpus_variables

Description Usage Arguments Value Examples

View source: R/corpus.R

Description

Set corpus meta-data variables from a data frame.

Usage

1
set_corpus_variables(corpus, dset)

Arguments

corpus

A Corpus object.

dset

A data.frame containing meta-data variables, with one row per document in 'corpus.

Value

A Corpus object with meta-data added.

Examples

1
2
3
4
5
file <- system.file("texts", "reut21578-factiva.xml", package="tm.plugin.factiva")
corpus <- import_corpus(file, "factiva", language="en")
dtm <- build_dtm(corpus)
dset <- data.frame(x=1:length(corpus))
corpus <- set_corpus_variables(corpus, dset)

R.temis documentation built on May 13, 2021, 1:08 a.m.