read_docx {officer}R Documentation

open a connection to a 'Word' file

Description

read and import a docx file as an R object representing the document.

Usage

read_docx(path = NULL)

## S3 method for class 'rdocx'
print(x, target = NULL, ...)

## S3 method for class 'rdocx'
length(x)

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

Examples

# 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"))
}

# how many elements are there in the document ----
length( read_docx() )


[Package officer version 0.3.5 Index]