epub_head: Preview the first n characters

Description Usage Arguments Details Value See Also Examples

View source: R/helpers.R

Description

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

Usage

1
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

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

epubr documentation built on June 19, 2021, 1:07 a.m.