Read tables from a Word file (docx)
Arguments
- path
the path to a Word file (docx).
- docx_header_pattern
one or more patterns of required table header names. Can be
character
or a list containing any combination ofcharacter
,regex
, andfixed
patterns. For case-insensitive, use regex.- combine
logical
indicating whether to combine the tables into one data frame or return a list of tables.- ...
optional arguments passed to
read_docx
.
Examples
if (FALSE) { # \dontrun{
# read and combine all tables from a docx.
read_docx_tables("results.docx")
# read and combine tables from a docx that match a pattern.
read_docx_tables(
path = "requirements.docx",
docx_header_pattern = list(
stringr::regex("variable", ignore_case = TRUE)
)
)
# optionally, read in with tracked changes accepted or rejected.
read_docx_tables(
path = "requirements.docx",
track_changes = "accept"
)
} # }