library(flextable)
dat <- iris[c(1:25, 51:75, 101:125),]
ft <- qflextable(dat)
ft <- keep_with_next(
x = ft,
i = c(1:24, 26:49, 51:74),
value = TRUE)
save_as_docx(ft, path = tempfile(fileext = ".docx"))
Run the code above in your browser using DataLab