body_add_crosstable: add a table made by the cross function into a officer...

Description Usage Arguments Value Author(s) Examples

View source: R/addCrossTable.r

Description

add a table made by the cross function into a officer document

Usage

1
2
3
body_add_crosstable(doc, crosstable, compact = FALSE, id = ".id",
  variable = "variable", value = "value", effect = "effect",
  p = "p", w = NULL, pos = "after", landscape = FALSE)

Arguments

doc

a docx object created by read_docx function (package flextable)

crosstable

the result of cross function

compact

compact the table?

id

name of the 'id' column

variable

name of the 'variable' column

value

name of the 'value' column

effect

name of the 'effect' column

p

name of the 'p' column

w

width of the table (if NULL, width of the current document is used)

pos

where to add the flextable relative to the cursor, one of "after", "before", "on" (end of line) (see ?body_add_flextable).

landscape

is the table inserted in a landscape section? (default: FALSE)

Value

A docx object

Author(s)

David Hajage

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
library(biostat2)
library(officer)
library(flextable)
mytable <- cross(cbind(...) ~ tobgp, esoph, test = TRUE)
doc <- read_docx()
doc <- body_add_crosstable(doc, mytable)
doc <- body_add_break(doc)
doc <- body_add_crosstable(doc, mytable, TRUE)

## End(Not run)

eusebe/biostat2 documentation built on Dec. 27, 2019, 4:22 p.m.