getDimPage: Get dimension of the page available for content for standard...

View source: R/miscellaneous.R

getDimPageR Documentation

Get dimension of the page available for content for standard Word report or PowerPoint presentation.

Description

Report is in A4 and presentation dimensions extracted from PowerPoint. The returned dimensions are the page dimensions without the margins.

Usage

getDimPage(
  type = c("width", "height"),
  landscape = (style == "presentation"),
  margin = 1,
  pageDim = NULL,
  style = "report"
)

Arguments

type

Character vector with dimension of interest, among: 'width', 'height', multiple are possible. By default: c("width", "height")

landscape

Logical, if TRUE the table is presented in landscape format.
By default: TRUE for style: 'report', FALSE for style: 'presentation'.

margin

Margin in the document in inches, 1 by default.

pageDim

(optional) Numeric vector of length 2 with page width and height in inches in portrait format, in case page dimensions differ from the default implemented report/presentation. These dimensions should include the margins.

style

String with table style, either 'report' (by default, a4 format) or 'presentation'

Value

numeric vector with dimension of interest, in the same order as specified via the type parameter.

Author(s)

Laure Cougnaud

Examples

## get part of the page available for content
# report A4 portrait format:
getDimPage(type = "width")
getDimPage(type = "height")
# report A4 landscape format:
getDimPage(type = "width", landscape = TRUE)
getDimPage(type = "height", landscape = TRUE)
# Note that the layout is by default set to 'landscape'
getDimPage(type = "width", style = "presentation")
getDimPage(type = "height", style = "presentation")
# custom dimensions: A3 format
getDimPage(type = "width", pageDim = c(11.7, 16.5))
# increase margin
getDimPage(type = "width", margin = 1.5)
# get both dimensions at once
getDimPage(type = c("width", "height"))
# get dimensions of the full page (including margins)
getDimPage(type = c("width", "height"), style = "report", margin = 0)
getDimPage(type = c("width", "height"), style = "presentation", margin = 0)

inTextSummaryTable documentation built on Sept. 12, 2023, 5:06 p.m.