Learn R Programming

textmineR (version 2.1.3)

Files2Vec: Function for reading text files into R

Description

This function reads in all files in a directory ending in .txt into R. The result is a character vector where each entry is a .txt file. The names of the resulting vector are derived from the names of the files.

Usage

Files2Vec(directory, ...)

Arguments

directory

A path to directory containing the files you want to read into R.

...

Other arguments to be passed to TmParallelApply. See note, below.

Value

Returns a character vector where each entry corresponds to a document.

Examples

Run this code
# NOT RUN {
my_text_vector <- Files2Vec("/path/to/my/data/")
# }

Run the code above in your browser using DataLab