# NOT RUN {
library(magrittr)
typology <- data.frame(
col_keys = c( "Sepal.Length", "Sepal.Width", "Petal.Length",
"Petal.Width", "Species" ),
what = c("Sepal", "Sepal", "Petal", "Petal", " "),
measure = c("Length", "Width", "Length", "Width", "Species"),
stringsAsFactors = FALSE )
typology
head(iris) %>%
flextable(
col_keys = c("Species",
"break1", "Sepal.Length", "Sepal.Width",
"break2", "Petal.Length", "Petal.Width") ) %>%
set_header_df(mapping = typology, key = "col_keys" ) %>%
merge_h(part = "header") %>%
theme_vanilla() %>%
empty_blanks() %>%
width(j = c(2, 5), width = .1 )
# }
Run the code above in your browser using DataLab