Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

set_header_labels

Set flextable's headers labels


Description

This function set labels for specified columns in a single row header of a flextable.

Usage

set_header_labels(x, ..., values = NULL)

Arguments

x

a flextable object

...

named arguments (names are data colnames), each element is a single character value specifying label to use.

values

a named list (names are data colnames), each element is a single character value specifying label to use. If provided, argument ... will be ignored.

Illustrations

See Also

Other headers and footers: add_header_lines(), add_header_row(), add_header(), set_header_footer_df

Examples

ft <- flextable( head( iris ))
ft <- set_header_labels(ft, Sepal.Length = "Sepal length",
  Sepal.Width = "Sepal width", Petal.Length = "Petal length",
  Petal.Width = "Petal width"
)

ft <- flextable( head( iris ))
ft <- set_header_labels(ft,
  values = list(Sepal.Length = "Sepal length",
                Sepal.Width = "Sepal width",
                Petal.Length = "Petal length",
                Petal.Width = "Petal width" ) )
ft

flextable

Functions for Tabular Reporting

v0.6.10
GPL-3
Authors
David Gohel [aut, cre], Clementine Jager [ctb], Quentin Fazilleau [ctb], Maxim Nazarov [ctb] (rmarkdown for docx output), Titouan Robert [ctb], Michael Barrowman [ctb] (inline footnotes), Atsushi Yasumoto [ctb] (support for bookdown cross reference), Paul Julian [ctb] (support for gam objects)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.