if (FALSE) { # interactive()
library(dplyr)
library(stringr)
gutenberg_metadata
gutenberg_metadata %>%
count(author, sort = TRUE)
# look for Shakespeare, excluding collections (containing "Works") and
# translations
shakespeare_metadata <- gutenberg_metadata %>%
filter(
author == "Shakespeare, William",
language == "en",
!str_detect(title, "Works"),
has_text,
!str_detect(rights, "Copyright")
) %>%
distinct(title)
# \donttest{
shakespeare_works <- gutenberg_download(shakespeare_metadata$gutenberg_id)
# }
# note that the gutenberg_works() function filters for English
# non-copyrighted works and does de-duplication by default:
shakespeare_metadata2 <- gutenberg_works(
author == "Shakespeare, William",
!str_detect(title, "Works")
)
# date last updated
attr(gutenberg_metadata, "date_updated")
}
Run the code above in your browser using DataLab