library(officer)
read_docx() %>%
body_add_title("Description", 1) %>%
body_add_title("Population A", 2) %>%
body_add_table_section(head(iris), "The iris dataset", sentence=TRUE) %>%
body_add_table_section(crosstable(iris), "A crosstable of the iris dataset",
title=FALSE, sentence=TRUE, body_fontsize=8) %>%
write_and_open()
Run the code above in your browser using DataLab