R: Create a huxtable

huxtable {huxtable} | R Documentation

## Create a huxtable

### Description

`huxtable`, or `hux`, creates a huxtable object.

### Usage

    huxtable(..., add_colnames = FALSE, add_rownames = FALSE)

    hux(..., add_colnames = FALSE, add_rownames = FALSE)

    as_huxtable(x, ...)

    as_hux(x, ...)

    ## Default S3 method:
    as_huxtable(x, add_colnames = FALSE, add_rownames = FALSE,
      ...)

    is_huxtable(x)

    is_hux(x)

### Arguments

`...` | Named list of values, as for `data.frame`.
`add_colnames` | If `TRUE`, add a first row of column names to the huxtable.
`add_rownames` | If `TRUE`, add a first column of row names, named 'rownames', to the huxtable.
`x` | An object to convert to a huxtable.

### Details

If you use `add_colnames` or `add_rownames`, be aware that these will shift your rows and columns along by one: your old row/column 1 will now be row/column 2, etc.

`as_huxtable` and `as_hux` convert an object to a huxtable. Conversion methods exist for data frames, tables, ftables, matrices and (most) vectors.

### Value

An object of class `huxtable`.

### Examples

    ht <- huxtable(column1 = 1:5, column2 = letters[1:5])
    dfr <- data.frame(a = 1:5, b = letters[1:5], stringsAsFactors = FALSE)
    as_huxtable(dfr)

[Package huxtable version 3.0.0 Index]