View source: R/gutenberg_download.R
gutenberg_download | R Documentation |
Download 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
)
gutenberg_id |
A vector of Project Gutenberg IDs, or a data frame
containing a |
mirror |
A mirror URL to retrieve the books from. By default uses the
mirror from |
strip |
Whether to strip suspected headers and footers using
|
meta_fields |
Additional fields describing each book, such as |
verbose |
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
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.