| DataframeSource {tm} | R Documentation |
Constructs a source from a data frame.
DataframeSource(x, encoding = "unknown")
x |
A data frame holding the texts. |
encoding |
encoding to be assumed for input strings. It is used to mark character strings as known to be in Latin-1 or UTF-8: it is not used to re-encode the input. |
An object of class DataframeSource which extends the class
Source representing a data frame interpreting each row as a
document.
Ingo Feinerer
getSources to list available sources. Encoding on encodings in R.
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))