|
| 1 | +#' Tidy data frame of the King James Version of the Bible |
| 2 | +#' |
| 3 | +#' Returns a tidy data frame of the King James Version of the Bible, with one |
| 4 | +#' verse for every row. There are several columns, including: \code{text}, which |
| 5 | +#' contains the text of each verse, \code{book_title}, the book of scripture, |
| 6 | +#' \code{chapter_number}, the chapter, and \code{verse_number}, the verse |
| 7 | +#' number. There are a dozen other columns as well: see "Details" for complete |
| 8 | +#' descriptions. |
| 9 | +#' |
| 10 | +#' Importantly, none of the title columns are ordered factors. It is the |
| 11 | +#' responsibility of the user to create ordered factors of book and volume |
| 12 | +#' titles when plotting results. |
| 13 | +#' |
| 14 | +#' @details Every row in the dataset is a verse, and there are 19 columns of |
| 15 | +#' metadata: |
| 16 | +#' \describe{ |
| 17 | +#' \item{\code{volume_id}}{Unique id number for the volume (1 = Old Testament, 2 = New Testament, etc.)} |
| 18 | +#' \item{\code{book_id}}{Unique id number for the book (1 = Genesis, 2 = Exodus, etc.)} |
| 19 | +#' \item{\code{chapter_id}}{Unique id number for the chapter (50 = Genesis 50, 51 = Exodus 1, etc.)} |
| 20 | +#' \item{\code{verse_id}}{Unique id number for the verse (31 = Genesis 1:31, 32 = Genesis 2:1)} |
| 21 | +#' \item{\code{volume_title}}{Name of the volume} |
| 22 | +#' \item{\code{book_title}}{Name of the book} |
| 23 | +#' \item{\code{volume_long_title}}{Full name of the volume} |
| 24 | +#' \item{\code{book_long_title}}{Full name of the book} |
| 25 | +#' \item{\code{volume_subtitle}}{Subtitle of the volume} |
| 26 | +#' \item{\code{book_subtitle}}{Subtitle of the book} |
| 27 | +#' \item{\code{volume_short_title}}{Volume abbreviation} |
| 28 | +#' \item{\code{book_short_title}}{Book abbreviation} |
| 29 | +#' \item{\code{volume_lds_url}}{Volume abbreviation used at scriptures.lds.org} |
| 30 | +#' \item{\code{book_lds_url}}{Book abbreviation used at scriptures.lds.org} |
| 31 | +#' \item{\code{chapter_number}}{Chapter (not unique; Genesis 50 = 50, Exodus 1 = 1, etc.)} |
| 32 | +#' \item{\code{verse_number}}{Verse (not unique; Genesis 1:31 = 31, Genesis 2:1 = 1)} |
| 33 | +#' \item{\code{text}}{Scripture text} |
| 34 | +#' \item{\code{verse_title}}{Combined book, chapter, and verse (e.g. Genesis 1:1)} |
| 35 | +#' \item{\code{verse_short_title}}{Abbreviated combined book, chapter, and verse (e.g. Gen. 1:1)} |
| 36 | +#' } |
| 37 | +#' |
| 38 | +#' @return A data frame with 31102 rows and 19 columns |
| 39 | +#' |
| 40 | +#' @name kjv_bible |
| 41 | +#' |
| 42 | +#' @examples |
| 43 | +#' library(dplyr) |
| 44 | +#' |
| 45 | +#' kjv_bible() %>% |
| 46 | +#' group_by(volume_title, book_title) %>% |
| 47 | +#' summarise(total_verses = n()) |
| 48 | +#' |
| 49 | +#' @export |
| 50 | +kjv_bible <- function() { |
| 51 | + ret <- rbind(scriptuRs::old_testament, |
| 52 | + scriptuRs::new_testament) |
| 53 | + |
| 54 | + structure(ret, class = c("tbl_df", "tbl", "data.frame")) |
| 55 | +} |
0 commit comments