clin_auto_page: Enable Word Auto-Pagination Using Group Variable

View source: R/pagination.R

clin_auto_pageR Documentation

Enable Word Auto-Pagination Using Group Variable

Description

This function uses the applies the functionality flextable::keep_with_next() by automatically building the row indices using some grouping variable. Each group identified by the variable (i.e. when the value of the variable changes) will be set as a "keep_with_next" group in Word. Using this functionality, Word will attempt not to break that group across pages, enabling smoother pagination without having to do specific calculations of page breaks.

Usage

clin_auto_page(x, group_var, when = c("change", "notempty"), drop = FALSE)

Arguments

x

A clintable object

group_var

A string containing a variable name of the input dataset used to calculate groups

when

Character string indicating when to apply padding:

  • "notempty": Find allowable break points when the value in group_var is not empty.

  • "change": Find allowable break points when the value in group_var changes from the previous row.

drop

Keep or drop the 'group_var“ variable

Value

A clintable object

Examples


clintable(mtcars) |>
  clin_auto_page("gear")


clinify documentation built on Aug. 8, 2025, 7:45 p.m.