load.corpus {stylo} | R Documentation |
Load text files
Description
Function for loading text files from a specified directory.
Usage
load.corpus(files = "all", corpus.dir = "", encoding = "UTF-8")
Arguments
files |
a vector of file names. The default value |
corpus.dir |
a directory containing the text files to be loaded; if not specified, the current working directory will be used. |
encoding |
useful if you use Windows and non-ASCII alphabets: French,
Polish, Hebrew, etc. In such a situation, it is quite convenient to
convert your text files into Unicode and to set this option to
|
Value
The function returns an object of the class stylo.corpus
. It is a list
containing as elements the texts loaded.
Author(s)
Maciej Eder
See Also
stylo
, classify
, rolling.classify
,
oppose
, txt.to.words
Examples
## Not run:
# to load file1.txt and file2.txt, stored in the subdirectory my.files:
my.corpus = load.corpus(corpus.dir = "my.files",
files = c("file1.txt", "file2.txt") )
# to load all XML files from the current directory:
my.corpus = load.corpus(files = list.files(pattern="[.]xml$") )
## End(Not run)
[Package stylo version 0.7.5 Index]