flextable (version 0.5.1)

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.

Examples

Run this code
# NOT RUN {
ft_1 <- flextable( head( iris ))
ft_1 <- set_header_labels(ft_1, Sepal.Length = "Sepal length",
  Sepal.Width = "Sepal width", Petal.Length = "Petal length",
  Petal.Width = "Petal width"
)

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

Run the code above in your browser using DataCamp Workspace