Learn R Programming

⚠️There's a newer version (5.6.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

14,138

Version

4.7.1

License

MIT + file LICENSE

Maintainer

David Hugh-Jones

Last Published

January 8th, 2020

Functions in huxtable (4.7.1)

bold

Cell text style
as_Workbook

Convert a huxtable for Excel
as_FlexTable

Convert a huxtable for Word/Powerpoint
by_cases

Map cell contents to properties using case_when
by_colorspace

Map numeric cell contents smoothly to colors
by_function

Map cell contents to cell properties using a function or scale
cbind.huxtable

Combine rows or columns
caption_pos

Caption position
by_values

Map specific cell values to cell properties
caption

Caption
escape_contents

Escape cell contents
every

Return every n row or column numbers
by_ranges

Map numeric ranges to cell properties
guess_knitr_output_format

Guess knitr output format
height

Table height
by_quantiles

Map numeric quantiles to cell properties
hux_logo

Huxtable logo
huxtable

Create a huxtable
mutate.huxtable

Dplyr verbs for huxtable
by_regex

Map cells matching a string or regex to cell properties
col_width

Column widths
huxtable-options

Package options
huxtable-package

Quick introduction to huxtable
[.huxtable

Subset a huxtable
label

Table label
row_height

Row heights
rowspan

Row and column span
knit_print.huxtable

Print a huxtable within knitr
by_rows

Set cell properties by row or column
font_size

Font size
font

Font
jams

Prices of 3 jams
merge_cells

Merge a range of cells
huxreg

Create a huxtable to display model output
insert_column

Insert a row or column
set_outer_borders

Set borders around a rectangle of cells
final

Return the last n rows or columns
left_border_style

Border styles
left_border_color

Border colors
set_default_properties

Default huxtable properties
knit_print.data.frame

Print data frames in knitr using huxtable
huxtable-FAQ

Frequently Asked Questions, including how to get help
latex_float

Float position for LaTeX
na_string

NA string
left_border

Borders
hux_hex

Deprecated functions
rotation

Text rotation
mapping-functions

How to set cell properties variably by cell contents
report_latex_dependencies

Tools for LaTeX dependencies
left_padding

Cell padding
valign

Vertical alignment
set_cell_properties

Set multiple cell properties
set_contents

Set cell contents
width

Table width
number_format

Number format
print_html

Create HTML representing a huxtable
t.huxtable

Transpose a huxtable
tidy_override

Override a model's tidy output
merge_repeated_rows

Merge repeated rows into multirow cells
sanitize

Escape text for various formats
text_color

Text color
tabular_environment

Tabular environment
themes

Theme a huxtable
quick-output

Quickly print objects to a PDF, TeX, HTML, Microsoft Office or RTF document.
set-multiple

Set left, right, top and bottom properties
reexports

Objects exported from other packages
position

Table position
print.huxtable

Default print method for huxtables
rowspecs

Different ways to select rows and columns
rtf_fc_tables

Create RTF font and color tables
print_rtf

Create RTF representing a huxtable
print_screen

Print a huxtable on screen
print_latex

Create LaTeX representing a huxtable
print_md

Create Markdown representing a huxtable
wrap

Text wrapping
background_color

Background color
add_rows

Insert one matrix into another.
add_colnames

Add column or row names
as_huxtable

Convert objects to huxtables
align

Alignment
add_footnote

Add a row with a footnote