ggpage_quick: Creates a quick visualization of the page layout

Description Usage Arguments Value Examples

Description

Creates a quick visualization of the page layout

Usage

1
2
3
ggpage_quick(book, lpp = 25, character_height = 3,
  vertical_space = 1, x_space_pages = 10, y_space_pages = 10,
  nrow = NULL, ncol = NULL, bycol = TRUE)

Arguments

book

Character or data.frame. Can either have each element be a separate line or having each element being separate words.

lpp

Numeric. Lines Per Page. Number of lines allocated for each page.

character_height

Numeric. Relative size of the height of each letter compared to its width.

vertical_space

Numeric. Distance between each lines vertically.

x_space_pages

Numeric. Distance between pages along the x-axis.

y_space_pages

Numeric. Distance between pages along the y-axis.

nrow

Numeric. Number of rows of pages, if omitted defaults to square layout.

ncol

Numeric. Number of columns of pages, if omitted defaults to square layout.

bycol

Logical. If TRUE (the default) the matrix is filled by columns, otherwise the matrix is filled by rows.

Value

A ggplot object with the given visualization.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(dplyr)
library(stringr)
library(ggplot2)
library(tidytext)
library(ggpage)
# quick
## data.frame with full lines
ggpage_quick(tinderbox)
## vector with full lines
ggpage_quick(tinderbox %>%
               pull(text))
## data.frame with single words
ggpage_quick(tinderbox %>%
               unnest_tokens(text, text))
## vector with single words
ggpage_quick(tinderbox %>%
               unnest_tokens(text, text) %>%
               pull(text))

# nrow and ncol
ggpage_quick(tinderbox, nrow = 2)
ggpage_quick(tinderbox, ncol = 2)

EmilHvitfeldt/ggpage documentation built on June 15, 2019, 8:31 a.m.