epub_head: Preview the first n characters

View source: R/helpers.R

epub_headR Documentation

Preview the first n characters

Description

Preview the first n characters of each EPUB e-book section.

Usage

epub_head(x, n = 50)

Arguments

x

a data frame returned by epub or a character string giving the EPUB filename(s).

n

integer, first n characters to retain from each e-book section.

Details

This function returns a simplified data frame of only the unnested section and text columns of a data frame returned by epub, with the text included only up to the first n characters. This is useful for previewing the opening text of each e-book section to inspect for possible useful regular expression patterns to use for text-based section identification. For example, an e-book may not have meaningful section IDs that distinguish one type of book section from another, such as chapters from non-chapter sections, but the text itself may contain this information at or near the start of a section.

Value

a data frame.

See Also

epub_cat

Examples


file <- system.file("dracula.epub", package = "epubr")
epub_head(file)


epubr documentation built on Sept. 10, 2023, 9:06 a.m.