corpus (version 0.10.1)

gutenberg_corpus: Project Gutenberg Corpora

Description

Get a corpus of texts from Project Gutenberg.

Usage

gutenberg_corpus(ids, filter = NULL, mirror = NULL, verbose = TRUE, ...)

Arguments

ids

an integer vector of requested Gutenberg text IDs.

filter

a text filter to set on the corpus.

mirror

a character string URL for the Gutenberg mirror to use, or NULL to determine automatically.

verbose

a logical scalar indicating whether to print progress updates to the console.

...

additional arguments passed to as_corpus.

Value

A corpus (data frame) with three columns: "title", "author", and "text".

Details

gutenberg_corpus downloads a set of texts from Project Gutenberg, creating a corpus with the texts as rows. You specify the texts for inclusion using their Project Gutenberg IDs, passed to the function in the ids argument.

You can search for Project Gutenberg texts and get their IDs using the gutenberg_works function from the gutenbergr package.

See Also

corpus_frame.

Examples

Run this code
# NOT RUN {
# get the texts of George Eliot's novels
# }
# NOT RUN {
eliot <- gutenberg_corpus(c(145, 550, 6688))
# }

Run the code above in your browser using DataCamp Workspace