Learn R Programming

⚠️There's a newer version (5.8.0) of this package.Take me there.

h

u

x

t

a

b

l

e

Huxtable is an R package to create styled tables in multiple output formats, with a friendly, modern interface. Features include:

  • Control over text styling, number format, background colour, borders, padding and alignment.
  • Table cells can span multiple rows and/or columns.
  • Table manipulation via standard R subsetting, or using dplyr.
  • Automatic formatting for knitr/rmarkdown documents.
  • huxreg() function for quick creation of regression tables.
  • Output to HTML, LaTeX, RTF, and Microsoft Word/Excel/Powerpoint, using the officer and openxlsx packages.
  • Quick one-liners to print data frames into a new PDF, HTML page, RTF or Microsoft document.
  • Formatted table display in the R console, including borders, colour, and text styles.

Installing

To install from CRAN:

install.packages('huxtable')

To install the latest version from github:

install.packages('remotes')
remotes::install_github('hughjonesd/huxtable')

Learning more

Check out the website, read the documentation or read the vignette in HTML or PDF.

Fund huxtable development

If you find huxtable useful, fund me on Patreon.

Copy Link

Version

Install

install.packages('huxtable')

Monthly Downloads

12,309

Version

4.7.0

License

MIT + file LICENSE

Maintainer

David Hugh-Jones

Last Published

October 3rd, 2019

Functions in huxtable (4.7.0)

as_huxtable

Convert objects to huxtables
add_rows

Insert one matrix into another.
as_Workbook

Convert a huxtable for Excel
add_colnames

Add column or row names
bold

Cell text style
by_regex

Map cells matching a string or regex to cell properties
by_quantiles

Map numeric quantiles to cell properties
font

Font
by_function

Map cell contents to cell properties using a function or scale
by_colorspace

Map numeric cell contents smoothly to colors
add_footnote

Add a row with a footnote
height

Table height
guess_knitr_output_format

Guess knitr output format
huxreg

Create a huxtable to display model output
hux_logo

Huxtable logo
knit_print.huxtable

Print a huxtable within knitr
caption_pos

Caption position
label

Table label
escape_contents

Escape cell contents
cbind.huxtable

Combine rows or columns
font_size

Font size
report_latex_dependencies

Tools for LaTeX dependencies
by_values

Map specific cell values to cell properties
caption

Caption
huxtable-FAQ

Frequently Asked Questions, including how to get help
huxtable

Create a huxtable
col_width

Column widths
jams

Prices of 3 jams
by_rows

Set cell properties by row or column
mutate.huxtable

Dplyr verbs for huxtable
insert_column

Insert a row or column
hux_hex

Deprecated functions
merge_repeated_rows

Merge repeated rows into multirow cells
merge_cells

Merge a range of cells
set_cell_properties

Set multiple cell properties
by_ranges

Map numeric ranges to cell properties
rotation

Text rotation
[.huxtable

Subset a huxtable
final

Return the last n rows or columns
left_border_color

Border colors
sanitize

Escape text for various formats
row_height

Row heights
rowspan

Row and column span
left_border_style

Border styles
set-multiple

Set left, right, top and bottom properties
na_string

NA string
knit_print.data.frame

Print data frames in knitr using huxtable
rowspecs

Different ways to select rows and columns
set_contents

Set cell contents
themes

Theme a huxtable
text_color

Text color
rtf_fc_tables

Create RTF font and color tables
set_outer_borders

Set borders around a rectangle of cells
set_default_properties

Default huxtable properties
print_latex

Create LaTeX representing a huxtable
number_format

Number format
print_md

Create Markdown representing a huxtable
huxtable-options

Package options
every

Return every n row or column numbers
mapping-functions

How to set cell properties variably by cell contents
left_padding

Cell padding
huxtable-package

Quick introduction to huxtable
tidy_override

Override a model's tidy output
print_html

Create HTML representing a huxtable
t.huxtable

Transpose a huxtable
position

Table position
print.huxtable

Default print method for huxtables
tabular_environment

Tabular environment
latex_float

Float position for LaTeX
print_rtf

Create RTF representing a huxtable
left_border

Borders
reexports

Objects exported from other packages
quick-output

Quickly print objects to a PDF, TeX, HTML, Microsoft Office or RTF document.
valign

Vertical alignment
print_screen

Print a huxtable on screen
width

Table width
wrap

Text wrapping
as_FlexTable

Convert a huxtable for Word/Powerpoint
align

Alignment
background_color

Background color
by_cases

Map cell contents to properties using case_when