Learn R Programming

flextable (version 0.9.11)

void: Clear the displayed content of selected columns

Description

void() replaces the visible text of the selected columns with an empty string. The columns themselves (and their headers) remain in the table, but the cell values are no longer displayed.

This is useful when a column should stay in the layout (e.g. to preserve its width or to keep its header label) but its body values should be hidden, for instance after using compose() to build a richer display in a neighbouring column that already incorporates those values.

The underlying dataset is not modified; only the displayed content is affected. To remove a column entirely, use the col_keys argument of flextable() instead.

Usage

void(x, j = NULL, part = "body")

Arguments

x

a 'flextable' object, see flextable-package to learn how to create 'flextable' object.

j

column selector, see section Column selection with the j parameter in <Selectors in flextable>.

part

part selector, see section Part selection with the part parameter in <Selectors in flextable>. Value 'all' can be used.

Examples

Run this code
ftab <- flextable(head(mtcars))
ftab <- void(ftab, ~ vs + am + gear + carb)
ftab

Run the code above in your browser using DataLab