Learn R Programming

tm (version 0.4)

DataframeSource: Data Frame Source

Description

Constructs a source from a data frame.

Usage

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

Arguments

object
A data frame holding the texts.
encoding
A character giving the encoding of the file.

Value

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

See Also

DataframeSource-class

Examples

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

Run the code above in your browser using DataLab