Learn R Programming

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

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 Microsoft Word, Excel, Powerpoint and RTF 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.

Copy Link

Version

Install

install.packages('huxtable')

Monthly Downloads

12,849

Version

4.3.0

License

MIT + file LICENSE

Maintainer

David Hugh-Jones

Last Published

November 7th, 2018

Functions in huxtable (4.3.0)

as_Workbook

Convert a huxtable for Excel
by_values

Map specific cell values to cell properties
cbind.huxtable

Combine rows or columns
add_footnote

Add a row with a footnote
font

Font
font_size

Font size
huxtable-package

Huxtable: simply create LaTeX and HTML tables
huxtable-options

Package options
escape_contents

Escape cell contents
by_quantiles

Map numeric quantiles to cell properties
by_ranges

Map numeric ranges to cell properties
add_rows

Insert one matrix into another.
huxtable-FAQ

Frequently Asked Questions
caption

Caption
align

Alignment
hux_hex

Deprecated functions
every

Return every n row or column numbers
left_padding

Cell padding
by_colorspace

Map numeric cell contents smoothly to colors
[.huxtable

Subset a huxtable
mapping-functions

How to set cell properties variably by cell contents
guess_knitr_output_format

Guess knitr output format
by_function

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

Border styles
left_border_color

Border colors
set-multiple

Set left, right, top and bottom properties
height

Table height
number_format

Number format
final

Return the last n rows or columns
set_cell_properties

Set multiple cell properties
bold

Cell text style
position

Table position
tidy_override

Override a model's tidy output
hux_logo

Huxtable logo
by_cases

Map cell contents to properties using case_when
print_html

Create HTML representing a huxtable
huxreg

Create a huxtable to display model output
rotation

Text rotation
by_regex

Map cells matching a string or regex to cell properties
merge_cells

Merge a range of cells
row_height

Row heights
valign

Vertical alignment
width

Table width
by_rows

Set cell properties by row or column
latex_float

Float position for LaTeX
knit_print.data.frame

Print data frames in knitr using huxtable
left_border

Borders
jams

Prices of 3 jams
na_string

NA string
rowspan

Row and column span
rowspecs

Different ways to select rows and columns
col_width

Column widths
mutate.huxtable

Dplyr verbs for huxtable
huxtable

Create a huxtable
insert_column

Insert a row or column
knit_print.huxtable

Print a huxtable within knitr
text_color

Text color
label

Table label
themes

Theme a huxtable
reexports

Objects exported from other packages
print.huxtable

Default print method for huxtables
report_latex_dependencies

Tools for LaTeX dependencies
quick-output

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

Set cell contents
rtf_fc_tables

Create RTF font and color tables
set_default_properties

Default huxtable properties
wrap

Text wrapping
t.huxtable

Transpose a huxtable
tabular_environment

Tabular environment
print_rtf

Create RTF representing a huxtable
print_screen

Print a huxtable on screen
sanitize

Escape text for various formats
print_latex

Create LaTeX representing a huxtable
print_md

Create Markdown representing a huxtable
add_colnames

Add column or row names
as_huxtable

Convert objects to huxtables
background_color

Background color
caption_pos

Caption position
as_FlexTable

Convert a huxtable for Word/Powerpoint