R/gutenberg_download.R
gutenberg_download.RdDownload one or more works by their Project Gutenberg IDs into a data frame
with one row per line per work. This can be used to download a single work of
interest or multiple at a time. You can look up the Gutenberg IDs of a work
using gutenberg_works() or the gutenberg_metadata dataset.
gutenberg_download(
gutenberg_id,
mirror = NULL,
strip = TRUE,
meta_fields = character(),
verbose = TRUE
)A vector of Project Gutenberg IDs, or a data frame
containing a gutenberg_id column, such as from the results of
gutenberg_works().
A mirror URL to retrieve the books from. By default uses the
mirror from gutenberg_get_mirror().
Whether to strip suspected headers and footers using
gutenberg_strip().
Additional fields describing each book, such as title
and author, to add from gutenberg_metadata.
Whether to show messages about the Project Gutenberg mirror that was chosen
A two column tbl_df (see tibble::tibble()) with one row for each
line of the text or texts, with columns
Integer column with the Project Gutenberg ID of each text
A character vector of lines of text
if (FALSE) { # interactive()
# download The Count of Monte Cristo
gutenberg_download(1184)
# download two books: Wuthering Heights and Jane Eyre
books <- gutenberg_download(c(768, 1260), meta_fields = "title")
books
dplyr::count(books, title)
# download all books from Jane Austen
austen <- gutenberg_works(author == "Austen, Jane") |>
gutenberg_download(meta_fields = "title")
austen
dplyr::count(austen, title)
}