#Officer
library(officer)
mytable = crosstable(mtcars2)
doc = read_docx() %>%
body_add_crosstable(mytable) %>%
body_add_break %>%
body_add_crosstable(mytable, compact=TRUE)
dfile = tempfile(fileext=".docx")
print(doc, target = dfile)
if(interactive()) browseURL(dfile)
Run the code above in your browser using DataLab