set_header_labels {flextable} | R Documentation |
Change headers labels
Description
This function set labels for specified columns in the bottom row header of a flextable.
Usage
set_header_labels(x, ..., values = NULL)
Arguments
x |
a |
... |
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 |
See Also
Other functions for row and column operations in a flextable:
add_body()
,
add_body_row()
,
add_footer()
,
add_footer_lines()
,
add_footer_row()
,
add_header()
,
add_header_row()
,
delete_columns()
,
delete_part()
,
delete_rows()
,
separate_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
ft <- flextable(head(iris))
ft <- set_header_labels(
x = ft,
values = c(
"Sepal length",
"Sepal width", "Petal length",
"Petal width", "Species")
)
ft