ifiles {text2vec} | R Documentation |
Creates iterator over text files from the disk
Description
The result of this function usually used in an itoken function.
Usage
ifiles(file_paths, reader = readLines)
idir(path, reader = readLines)
ifiles_parallel(file_paths, reader = readLines, ...)
Arguments
file_paths |
|
reader |
|
path |
|
... |
other arguments (not used at the moment) |
See Also
Examples
## Not run:
current_dir_files = list.files(path = ".", full.names = TRUE)
files_iterator = ifiles(current_dir_files)
parallel_files_iterator = ifiles_parallel(current_dir_files, n_chunks = 4)
it = itoken_parallel(parallel_files_iterator)
dtm = create_dtm(it, hash_vectorizer(2**16), type = 'TsparseMatrix')
## End(Not run)
dir_files_iterator = idir(path = ".")
[Package text2vec version 0.6.4 Index]