Learn R Programming

tm (version 0.5-3)

VectorSource: Vector Source

Description

Constructs a source for a vector as input.

Usage

VectorSource(x, encoding = "UTF-8")

Arguments

x
A vector.
encoding
A character giving the encoding of x.

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.

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 DataLab