wdTable: Write a dataframe or an array as a Word table.

Description Usage Arguments Details Author(s) Examples

Description

Make a Word table to the adequate dimensions, fill it, format it, and add a bookmark (and a caption - doesn't work yet).

Usage

1
wdTable(data, caption = "", caption.pos="below",bookmark = NULL, pointsize = 9, padding = 5, autoformat = 1, row.names=TRUE,align = if (row.names) c("l",rep("r", ncol(data))) else c(rep("r", ncol(data))),hlines=NULL,wdapp = .R2wd)

Arguments

data

a data frame or an array

caption

the caption to use in Word

caption.pos

the caption position "below" or "above"

bookmark

the bookmark to use in Word

pointsize

the pointsize in Word

padding

how much cell-padding (in points)

autoformat

which of the Word autoformats to use (try 1, 2, 3)

row.names

whether row names should be printed (default=TRUE)

align

alignment instruction. Default: c("l",rep("r",ncol(data))): align first column left and the others right. "c" stands for centering. The character "|" can be inserted where the user wishes a vertical line to be drawn.

hlines

a character vector of length nrow(data)+1 containing "b","t","bt",or "n" to indicate whether a horizontal line should be drawn below, on top, or both. "n" means none.

wdapp

the handle to the Word Application (usually not needed).

Details

Creates a Word table to the adequate dimensions and inserts it between two paragraph breaks. Fills it with dataframe or array (using the clipboard). Creates a bookmark and adds a caption. Uses word autoformating and aligns columns according to user input.

Author(s)

Christian Ritter

Examples

1
2
3
4
5
6
## Not run: 
wdGet()
wdTitle("The example mtcars")
wdTable(format(mtcars))

## End(Not run)

R2wd documentation built on May 2, 2019, 8:54 a.m.