read_docx
From officer v0.3.14
by David Gohel
Create a 'Word' document object
read and import a docx file as an R object representing the document. When no file is specified, it uses a default empty file.
Use then this object to add content to it and create Word files from R.
Usage
read_docx(path = NULL)# S3 method for rdocx
print(x, target = NULL, ...)
Arguments
- path
path to the docx file to use as base document.
- x
an rdocx object
- target
path to the docx file to write
- ...
unused
styles
read_docx()
uses a Word file as the initial document.
This is the original Word document from which the document
layout, paragraph styles, or table styles come.
You will be able to add formatted text, change the paragraph style with the R api, but it will always be easier to use the styles from the original document.
See body_add_*
functions to add content.
See Also
Examples
# NOT RUN {
# create an rdocx object with default template ---
read_docx()
print(read_docx())
# write a rdocx object in a docx file ----
if( require(magrittr) ){
read_docx() %>% print(target = tempfile(fileext = ".docx"))
}
# }
Community examples
Looks like there are no examples yet.