Learn R Programming

docxtools (version 0.1.0)

align_pander: Align the columns of a pander table.

Description

Uses pander() to print a data frame as a table to the output document.

Usage

align_pander(x, align_idx = NULL, caption = NULL)

Arguments

x
: A data frame to be printed in the output document.
align_idx
: Optional string made up of l (left-aligned), r (right-aligned), and c (center-aligned).
caption
: Optional string used as the pander() caption argument.

Value

Prints the data frame in table form using pander(x).

Details

Uses panderOptions('table.alignment.default') argument to assign output column alignment.

The default alignments are numeric right and everything else left.

Examples

Run this code
x <- mtcars[1:5, 1:5]
align_pander(x)
align_pander(x, align_idx = "rcrrr")
align_pander(x, caption = "A nicely formatted table")

Run the code above in your browser using DataLab