R: Convert a huxtable for Word/Powerpoint

as_FlexTable {huxtable} | R Documentation

## 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, ...)

    as_flextable(x, ...)

    ## S3 method for class 'huxtable'
    as_flextable(x, ...)

### Arguments

`x` | A huxtable.
`...` | Not used.

### Details

Note: you can't use flextable Word output within rmarkdown. Instead you have to write the Word file yourself. See `read_docx`.

`as_FlexTable` is deprecated and calls `as_flextable` with a warning.

Properties are supported, with the following exceptions:

- Rotation of 0, 90 or 270 is supported.

- Non-numeric column widths and row heights are not supported.

- Table height, wrap, captions and table position are not supported.

### Value

an object of class flextable.

### Challenge

Try to say `as_flextable.huxtable` ten times without pausing.

### Examples

    ht <- hux(a = 1:3, b = 1:3)
    ft <- as_flextable(ht)
    ## Not run:
      my_doc <- officer::read_docx()
      my_doc <- flextable::body_add_flextable(my_doc, ft)
      print(my_doc, target = "path/to/my_doc.docx")

    ## End(Not run)

[Package huxtable version 3.0.0 Index]