writeCorpus: Write a Corpus to Disk

Description Usage Arguments Details Examples

View source: R/corpus.R

Description

Write a plain text representation of a corpus to multiple files on disk corresponding to the individual documents in the corpus.

Usage

1
writeCorpus(x, path = ".", filenames = NULL)

Arguments

x

A corpus.

path

A character listing the directory to be written into.

filenames

Either NULL or a character vector. In case no filenames are provided, filenames are automatically generated by using the documents' identifiers in x.

Details

The plain text representation of the corpus is obtained by calling as.character on each document.

Examples

1
2
3
4
data("crude")
## Not run: writeCorpus(crude, path = ".",
            filenames = paste(seq_along(crude), ".txt", sep = ""))
## End(Not run)

tm documentation built on Nov. 18, 2020, 5:07 p.m.