DirSource {tm} | R Documentation |
Directory Source
Description
Create a directory source.
Usage
DirSource(directory = ".",
encoding = "",
pattern = NULL,
recursive = FALSE,
ignore.case = FALSE,
mode = "text")
Arguments
directory |
A character vector of full path names; the default
corresponds to the working directory |
encoding |
a character string describing the current encoding. It is
passed to |
pattern |
an optional regular expression. Only file names which match the regular expression will be returned. |
recursive |
logical. Should the listing recurse into directories? |
ignore.case |
logical. Should pattern-matching be case-insensitive? |
mode |
a character string specifying if and how files should be read in. Available modes are: |
Details
A directory source acquires a list of files via dir
and
interprets each file as a document.
Value
An object inheriting from DirSource
, SimpleSource
, and
Source
.
See Also
Source
for basic information on the source infrastructure
employed by package tm.
Encoding
and iconv
on encodings.
Examples
DirSource(system.file("texts", "txt", package = "tm"))