huxtable (version 0.2.1)

as_FlexTable: Convert a huxtable for Word/Powerpoint

Description

Huxtables can be converted to FlexTable objects, for use in Word and Powerpoint documents.

Usage

as_FlexTable(x, ...)

# S3 method for huxtable as_FlexTable(x, header_rows = 0, footer_rows = 0, ...)

Arguments

x
A huxtable.
...
Not currently used.
header_rows
How many rows to use as headers.
footer_rows
How many rows to use as footers.

Value

an object of class FlexTable.

Challenge

Try to say as_FlexTable.huxtable ten times without pausing.

Details

Note: you can't use ReporteRs Word output with R markdown word output. Instead you have to write the Word file yourself. See the ReporteRs documentation. Properties are supported, with the following exceptions:
  • Cells can span only multiple rows or multiple columns, but not both.
  • Rotation of 0, 90 or 270 is supported, only in header rows.
  • Non-numeric column widths and table widths are not supported. Table width is treated as a fraction of 6 inches.
  • Table height, row heights, wrap, captions and table position are not supported.

Examples

Run this code
if (require('ReporteRs')) {
  ht <- huxtable(a = 1:3, b = 1:3)
  ft <- as_FlexTable(ht)
  ft
  my_doc <- docx()
  my_doc <- addFlexTable(my_doc, ft)
}

Run the code above in your browser using DataCamp Workspace