set_wb_widths: Set column widths to tab workbook

Description Usage Arguments Examples

Description

Set column widths to tab workbook

Usage

1
2
set_wb_widths(tab, left_header_col_widths = NULL,
  body_header_col_widths = NULL)

Arguments

tab

The core tab object

left_header_col_widths

Width of row header columns you wish to set in Excel column width units. If singular, value is applied to all row header columns. If a vector, vector must have length equal to the number of row headers in workbook. Use special case "auto" for automatic sizing. Default (NULL) leaves column widths unchanged.

body_header_col_widths

Width of body header columns you wish to set in Excel column width units. If singular, value is applied to all body columns. If a vector, vector must have length equal to the number of body headers in workbook. Use special case "auto" for automatic sizing. Default (NULL) leaves column widths unchanged.

Examples

1
2
3
4
5
crosstab <- read.csv(system.file("extdata", "example_crosstab.csv", package="xltabr"))
tab <- initialise()
colnames <- c("drive", "age")
tab <- add_body(tab, crosstab, left_header_colnames = colnames)
tab <- set_wb_widths(tab, left_header_col_widths = "auto", body_header_col_widths = c(7,14,28))

xltabr documentation built on May 2, 2019, 9:11 a.m.

Related to set_wb_widths in xltabr...