Learn R Programming

tm (version 0.5-1)

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.

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