Learn R Programming

tm (version 0.5-5)

DataframeSource: Data Frame Source

Description

Constructs a source from a data frame.

Usage

DataframeSource(x, encoding = "UTF-8")

Arguments

x
A data frame holding the texts.
encoding
A character giving the encoding of x.

Value

  • An object of class DataframeSource which extends the class Source representing a data frame interpreting each row as a document.

See Also

getSources to list available sources.

Examples

Run this code
docs <- data.frame(docs = c("This is a text.", "This another one."),
                   row.names = c("Text 1", "Text 2"))
(ds <- DataframeSource(docs))
inspect(Corpus(ds))

Run the code above in your browser using DataLab