phl_adjust_table: Create flextable for layout's placeholder.

Description Usage Arguments Value Examples

View source: R/flextable.R

Description

Create flextable from data.frame and try to fit the result into layout's placeholder.

Usage

1
phl_adjust_table(x, olay, id, method = c("all", "height"))

Arguments

x

data.frame.

olay

officer layout created using phl_layout.

id

of placeholder in olay.

method

if 'all' (default) fits both the width and height. If 'height' fits only height.

Value

A flextable object, which should fit into the layout's placeholder.

The result should be ready to pass it into phl_with_flextable.

Examples

1
2
3
4
5
6
7
8
9
lay <- lay_new(matrix(1:4,nc=2),widths=c(3,2),heights=c(2,1))
lay2 <- lay_new(matrix(1:3))
lay3 <- lay_bind_col(lay,lay2, widths=c(3,1))
offLayout <- phl_layout(lay3)

x <- tail(iris, 10)[,c(1,5)]

phl_adjust_table(x, offLayout, 1)
phl_adjust_table(x, offLayout, 2)

zzawadz/customLayout documentation built on June 9, 2021, 11:10 a.m.