Learn R Programming

tm (version 0.5-9.1)

URISource: Uniform Resource Identifier Source

Description

Constructs a source which represents a single document located by a uniform resource identifier.

Usage

URISource(x, encoding = "unknown")

Arguments

x
The Uniform Resource Identifier, i.e., either a character identifying the file or a connection.
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 URISource which extends the class Source representing a single document located by a URI.

See Also

DirSource for accessing multiple files, and getSources to list available sources. Encoding on encodings in R.

Examples

Run this code
loremipsum <- system.file("texts", "loremipsum.txt", package = "tm")
us <- URISource(loremipsum)
inspect(Corpus(us))

Run the code above in your browser using DataLab