# NOT RUN {
library(officer)
library(crosstable)
info_rows = c("Also, table iris has {nrow(iris)} rows.",
"And table mtcars has {nrow(mtcars)} rows.")
doc = read_docx() %>%
body_add_normal("Table iris has", ncol(iris), "columns.", .sep=" ") %>% #paste style
body_add_normal("However, table mtcars has {ncol(mtcars)} columns") %>% #glue style
body_add_normal(info_rows) #vector style
#write_and_open(doc)
# }
Run the code above in your browser using DataLab