if (FALSE) { # interactive()
library(dplyr)
# Download a book without stripping to see the headers
book <- gutenberg_works(title == "Pride and Prejudice") |>
gutenberg_download(strip = FALSE)
# Look at the raw header and footer
head(book$text, 20)
tail(book$text, 20)
# Manually strip the text
text_stripped <- gutenberg_strip(book$text)
# Check the cleaned results
head(text_stripped, 10)
tail(text_stripped, 10)
}
Run the code above in your browser using DataLab