Learn R Programming

stylo (version 0.5.2)

load.corpus: Load text files

Description

Function for loading text files from a specified directory.

Usage

load.corpus(files, corpus.dir = "")

Arguments

files
a vector of file names.
corpus.dir
a directory containing the text files to be loaded; if not specified, the current working directory will be used.

Value

  • The function returns a variable (list), containing as elements the texts loaded.

See Also

stylo, classify, rolling.delta, oppose

Examples

Run this code
# 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$") )

Run the code above in your browser using DataLab