powered by
Create a directory source.
DirSource(directory = ".", encoding = "", pattern = NULL, recursive = FALSE, ignore.case = FALSE, mode = "text")
A character vector of full path names; the default corresponds to the working directory getwd().
getwd()
a character string describing the current encoding. It is passed to iconv to convert the input to UTF-8.
iconv
an optional regular expression. Only file names which match the regular expression will be returned.
logical. Should the listing recurse into directories?
logical. Should pattern-matching be case-insensitive?
a character string specifying if and how files should be read in. Available modes are:
""
No read. In this case getElem and pGetElem only deliver URIs.
getElem
pGetElem
"binary"
Files are read in binary raw mode (via readBin).
readBin
"text"
Files are read as text (via readLines).
readLines
An object inheriting from DirSource, SimpleSource, and Source.
DirSource
SimpleSource
Source
A directory source acquires a list of files via dir and interprets each file as a document.
dir
Source for basic information on the source infrastructure employed by package tm.
Encoding and iconv on encodings.
Encoding
# NOT RUN { DirSource(system.file("texts", "txt", package = "tm")) # }
Run the code above in your browser using DataLab