Description Usage Arguments Value Examples
View source: R/wikisource_page.R
Download the text of a Wikisource page into a data frame using its url.
1 | wikisource_page(wikiurl, page = NA, cleaned = TRUE)
|
wikiurl |
The url of a Wikisource page that will be downloaded. |
page |
A string naming the Wikisource page downloaded. |
cleaned |
A boolean variable for cleaning the Wikisource page. |
A four column tbl_df (a type of data frame; see tibble or dplyr packages) with one row for each line of the text or texts, with four columns.
A character column
A column naming the page downloaded
A character column with a two letter string refering to the language of the text
A character column with the url of the Wikisource page of the text
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
# download Sonnet 18 of Shakespeare
wikisource_page("https://en.wikisource.org/wiki/Shakespeare%27s_Sonnets/Sonnet_18", "Sonnet 18")
# download Sonnets 116, 73 and 130 of Shakespeare
library(purrr)
urls <- paste0("https://en.wikisource.org/wiki/Shakespeare%27s_Sonnets/Sonnet_", c(116, 73, 130))
sonnets <- map2_df(urls, paste0("Sonnet ", c(116, 73, 130)), wikisource_page)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.