Learn R Programming

tm (version 0.3-3)

VectorSource: Gmane Source

Description

Constructs a source for a vector.

Usage

## S3 method for class 'vector':
VectorSource(object, encoding = "UTF-8")

Arguments

object
A vector holding the texts.
encoding
A character giving the encoding of the file.

Value

  • An S4 object of class VectorSource which extends the class Source representing a vector interpreting each element as a document.

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