The wikisourcer R package helps you download public domain works from the free library Wikisource.

It includes two functions for downloading books and pages by url.

Minimal examples

Download Voltaire’s philosophical novel Candide.

library(wikisourcer)

wikisource_book("https://en.wikisource.org/wiki/Candide")

Download Voltaire’s Candide books in French, Spanish and Italian.

Download Sonnet 18 of William Shakespeare.

library(wikisourcer)

wikisource_page("https://en.wikisource.org/wiki/Sonnet_18_(Shakespeare)", "Sonnet 18")

Download 154 Sonnets of William Shakespeare.

For more information on how to use wikisourcer, please read the vignette.