get_fraction: Get Fraction of a Chapter or Book

View source: R/get_bible.R

get_fractionR Documentation

Get Fraction of a Chapter or Book

Description

Extracts a specified fraction of a chapter from a given book or a portion of a book.

Usage

get_fraction(book, chapter, fraction, part, language = NULL, testament = NULL)

Arguments

book

A character string or vector specifying the book(s) from which the chapter is retrieved.

chapter

A numeric vector indicating the chapter number(s) to be processed.

fraction

A numeric value representing the total number of sections into which the chapter should be divided. Must be an integer greater than or equal to 1.

part

A numeric value indicating which section of the divided chapter to return. Must satisfy 1 <= part <= fraction.

language

An optional character string indicating the language of the Bible. Typically one of "English", "Hebrew", or "Greek". Default is NULL.

testament

An optional character string specifying the testament. Should be "Old Testament", "New Testament", or "Both". Default is NULL.

Details

This function validates the fraction and part parameters, retrieves the full chapter text using retrieve_chapter(), and calculates the corresponding section of the chapter to return. The chapter is divided into equal parts based on the number of verses, and the function extracts the verses corresponding to the requested part.

Value

A character vector containing the verses from the specified section of the chapter.


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