View source: R/merge_flextable.R
| merge_h | R Documentation |
Merge flextable cells horizontally when consecutive cells have identical values. Text of formatted values are used to compare values.
merge_h(x, i = NULL, part = "body")
x |
a 'flextable' object, see flextable-package to learn how to create 'flextable' object. |
i |
row selector, see section Row selection with the |
part |
part selector, see section Part selection with the |
Other cell merging functions:
merge_at(),
merge_h_range(),
merge_none(),
merge_v()
library(flextable)
schedule <- data.frame(
time = c("9h", "10h", "11h", "14h", "15h", "16h"),
monday = c("Math", "Math", "French", "History", "Science", "French"),
tuesday = c("English", "Math", "Art", "Math", "Math", "French"),
wednesday = c("Science", "Math", "Science", "English", "English", "French"),
stringsAsFactors = FALSE
)
ft <- flextable(schedule)
ft <- theme_box(ft)
ft <- merge_h(ft)
ft
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.