span_header: Span the header based on delimiters

View source: R/header-transform.R

span_headerR Documentation

Span the header based on delimiters

Description

Span the header based on delimiters

Usage

span_header(x, sep = "[_.]", theme_fun = NULL, ...)

Arguments

x

A flextable object'

sep

Separator between columns.

If character, sep is interpreted as a regular expression. The default value is a regular expression that matches any sequence of non-alphanumeric values.

If numeric, sep is interpreted as character positions to split at. Positive values start at 1 at the far-left of the string; negative value start at -1 at the far-right of the string. The length of sep should be one less than into.

theme_fun

A flextable theme function. When NULL (default), the value is resolved by flextable::get_flextable_defaults().

...

Passed to theme_fun

Note

split_header is a rename of separate_header and the latter will be removed in the future release.

Examples

iris %>%
  flextable() %>%
  span_header()

ftExtra documentation built on Sept. 29, 2023, 9:06 a.m.