Create a ZIP file source.
ZipSource(zipfile,
pattern = NULL,
recursive = FALSE,
ignore.case = FALSE,
mode = "text")
A character string with the full path name of a ZIP file.
an optional regular expression. Only file names in the ZIP file which match the regular expression will be returned.
logical. Should the listing recurse into directories?
logical. Should pattern-matching be case-insensitive?
An object inheriting from ZipSource
, SimpleSource
, and
Source
.
A ZIP file source extracts a compressed ZIP file via
unzip
and interprets each file as a document.
Source
for basic information on the source infrastructure
employed by package tm.
# NOT RUN {
zipfile <- tempfile()
files <- Sys.glob(file.path(system.file("texts", "txt", package = "tm"), "*"))
zip(zipfile, files)
zipfile <- paste0(zipfile, ".zip")
Corpus(ZipSource(zipfile, recursive = TRUE))[[1]]
file.remove(zipfile)
# }
Run the code above in your browser using DataLab