get_paper: Get standard paper and image sizes

View source: R/get_paper.R

get_paperR Documentation

Get standard paper and image sizes

Description

Use the "paper" parameter (matching name from paper_sizes), standard (optionally including series and size) parameter, or width, height and units. May return multiple paper sizes depending on parameters.

Usage

get_paper(
  paper = "letter",
  orientation = "portrait",
  standard = NULL,
  series = NULL,
  size = NULL,
  width = NULL,
  height = NULL,
  units = NULL,
  cols = 1,
  rows = 1,
  gutter = 0,
  bbox = NULL,
  margin = NULL,
  ...
)

Arguments

paper

Paper, Default: 'letter'.

orientation

Orientation "portrait", "landscape", or "square", Default: 'portrait'.

standard

Size standard, "ANSI", "ISO", "British Imperial", "JIS", "USPS", "Facebook", "Instagram", or "Twitter".

series

Size series (e.g. A), Default: NULL

size

Size number (only used for "ISO" and "JIS" series). Standard, series, and size may all be required to return a single paper when using these parameters.

width, height

Width and height in units, Default: NULL.

units

Paper size units, either "in", "mm", or "px"; defaults to NULL (using "in" if width or height are provided).

cols, rows

Number of expected columns and rows in paper; used to determine row_height and section_asp in paper data frame returned by get_paper if rows or cols is greater than 1; defaults to NULL.

gutter

Gutter distance in units. Gutter is used as the spacing between rows and columns (variable spacing is not currently supported); defaults to 0.

bbox

A bounding box to use to get orientation using sf_bbox_asp() with orientation = TRUE.

margin

Margin style (options include "extrawide", "wide", "standard", "narrow", "none"), Additional "auto" option to generate margin based on line length is planned but not yet implemented. Default: NULL (equivalent to "none").

...

Additional parameters passed to get_margin. plot_width can only be passed in these parameters if paper has only a single row. margin is returned as a list column.

Details

If margin is provided, a block_width, block_height, and block_asp are calculated and included as columns in the returned data frame.

Paper can also be a data frame with "width", "height", "orientation", and "units" columns.

Value

Data frame with one or more paper/image sizes.

Examples

get_paper("letter")

get_paper(paper = NULL, standard = "ISO", series = "A", size = 4)

get_paper(width = 11, height = 17)

elipousson/overedge documentation built on Aug. 13, 2022, 7:41 p.m.