Learn R Programming

R2wd (version 1.4)

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

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

wdTable(data, caption = "", bookmark = NULL, pointsize = 9, padding = 5, autoformat = 1, align = c("l", rep("r", ncol(data))), wdapp = .R2wd)

Arguments

data
a data frame or an array
caption
the caption to use in Word (doesn't work yet)
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)
align
alignment instruction. Default: c("l",rep("r",ncol(data))): align first column left and the others right. "c" stands for centering.
wdapp
the handle to the Word Application (usually not needed).

Value

    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.

    Examples

    Run this code
    wdGet()
    wdTitle("The example mtcars")
    wdTable(format(mtcars))

    Run the code above in your browser using DataLab