Learn R Programming

phm (version 2.1.2)

readDF: Create a PlainTextDocument from a row in a data frame

Description

Read a row of the content of a DFSource object into a PlainTextDocument.

Usage

readDF(elem, language, id = "1")

Value

A PlainTextDocument with content equal to the contents of the text field, and meta data containing the information in the remaining fields, including the id field

Arguments

elem

A list containing the field content containing one row with data from a data frame containing at least the columns id and text, but possibly more.

language

abbreviation of the language used; "en" for English

id

Not used, but needed for VCorpus

Examples

Run this code
(df=data.frame(id=1:3,text=c("First text","Second text","Third text"),
               title=c("N1","N2","N3")))
readDF(list(content=df[1,]),"en")

Run the code above in your browser using DataLab