Learn R Programming

text2vec (version 0.2.0)

ifiles: Creates iterator over text/serialized files from the disk

Description

Result of this function usually used in itoken function.

Usage

ifiles(file_paths, serialized = FALSE, reader_function = read_lines, ...)

idir(path, serialized = FALSE, reader_function = read_lines, ...)

Arguments

file_paths
character paths of input files
serialized
logical indicates, whether to read raw text files or pre-tokenized list of character vectors, saved to disk in serialized form (.RData, .rds files).
reader_function
function which will perform reading of text files from disk. Only one assumption - it should take path as first argument.
...
arguments passed to other methods (inculding reader_function).
path
character path of directory, from where read ALL the files.

See Also

itoken

Examples

Run this code
current_dir_files <- list.files(path = ".", full.names = TRUE)
files_iterator <- ifiles(current_dir_files)
dir_files_iterator <- idir(path = ".")

Run the code above in your browser using DataLab