tm (version 0.5-10)

VectorSource: Vector Source

Description

Constructs a source for a vector as input.

Usage

VectorSource(x, encoding = "unknown")

Arguments

x
A vector.
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.

Value

  • An object of class VectorSource which extends the class Source representing a vector where each entry is interpreted as a document.

See Also

getSources to list available sources. Encoding on encodings in R.

Examples

Run this code
docs <- c("This is a text.", "This another one.")
(vs <- VectorSource(docs))
inspect(Corpus(vs))

Run the code above in your browser using DataCamp Workspace