read content of a Word document and return a data.frame representing the document.
docx_summary(x, preserve = FALSE, remove_fields = FALSE)
an rdocx object
If FALSE
(default), text in table cells is collapsed into a
single line. If TRUE
, line breaks in table cells are preserved as a "\n"
character. This feature is adapted from docxtractr::docx_extract_tbl()
published under a MIT licensed in
the {docxtractr}
package by Bob Rudis.
if TRUE, prevent field codes from appearing in the returned data.frame.
example_docx <- system.file(
package = "officer",
"doc_examples/example.docx"
)
doc <- read_docx(example_docx)
docx_summary(doc)
docx_summary(doc, preserve = TRUE)[28, ]
Run the code above in your browser using DataLab