select_passage: Select a book, passage or portion of a book from the old or...

View source: R/passage.R

select_passageR Documentation

Select a book, passage or portion of a book from the old or new testament

Description

Retrieves a whole book(s), passage from a book or a portion of a book or chapter, based on specified criteria such as book, chapter, verse, or alternative selection using author, section, or date.

Usage

select_passage(
  book = NULL,
  chapter = NULL,
  verse = NULL,
  fraction = 1,
  part = 1,
  by = NULL,
  divider = NULL,
  language = "English",
  testament = NULL
)

Arguments

book

A character vector specifying the book name(s) from which to select the passage. Ignored if the by parameter is provided.

chapter

A numeric vector indicating the chapter(s) of the book. If selection by section, author or date is used, the chapter must be set to NULL.

verse

A numeric vector indicating the verse(s) within the chapter.

fraction

A numeric value (default 1) indicating how many equal parts to divide the chapter into.

part

A numeric value specifying which part to return (must be between 1 and fraction).

by

An optional character string for alternative selection criteria. It should be one of "author", "section", or "date". When provided, the book, chapter, and verse parameters must be NULL.

divider

A character vector specifying the author, section or date range to be selected.

language

A character string indicating the language of the passage. Must be one of "English", "Hebrew", or "Greek". Default is "English".

testament

A character string specifying the testament. Must be one of "Old", "New", or "Both" (case-insensitive). This parameter is required.

Details

This function validates the input parameters and determines the book(s) to be used based on the provided criteria. If the by argument is given, the function leverages helper functions such as by_author(), by_section(), or by_date() to select the appropriate book(s) based on the alternative criterion. The passage is then retrieved via retrieve_chapter(), applying verse filtering and partitioning based on the fraction and part arguments.

Value

Returns the selected passage as generated by the retrieve_chapter() function.

Examples

# Example 1: Select a passage by specifying book, chapter, and verse.
select_passage(book = "Genesis", chapter = 1, verse = 1, testament = "Old")
select_passage(book = "Mat", chapter = 1, verse = 1:10, testament = "new")

logos documentation built on April 4, 2025, 4:42 a.m.