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.

Copy Link

Version

Install

install.packages('huxtable')

Monthly Downloads

8,928

Version

4.5.0

License

MIT + file LICENSE

Maintainer

David Hugh-Jones

Last Published

March 19th, 2019

Functions in huxtable (4.5.0)

add_rows

Insert one matrix into another.
bold

Cell text style
by_colorspace

Map numeric cell contents smoothly to colors
by_rows

Set cell properties by row or column
by_cases

Map cell contents to properties using case_when
as_Workbook

Convert a huxtable for Excel
as_huxtable

Convert objects to huxtables
by_function

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

Background color
by_quantiles

Map numeric quantiles to cell properties
col_width

Column widths
by_ranges

Map numeric ranges to cell properties
escape_contents

Escape cell contents
as_FlexTable

Convert a huxtable for Word/Powerpoint
add_colnames

Add column or row names
mutate.huxtable

Dplyr verbs for huxtable
caption_pos

Caption position
every

Return every n row or column numbers
guess_knitr_output_format

Guess knitr output format
height

Table height
huxtable-options

Package options
huxtable-package

Huxtable: simply create LaTeX and HTML tables
add_footnote

Add a row with a footnote
cbind.huxtable

Combine rows or columns
left_border_style

Border styles
left_border_color

Border colors
huxtable-FAQ

Frequently Asked Questions
hux_hex

Deprecated functions
by_values

Map specific cell values to cell properties
caption

Caption
merge_cells

Merge a range of cells
rotation

Text rotation
na_string

NA string
insert_column

Insert a row or column
huxtable

Create a huxtable
row_height

Row heights
rowspan

Row and column span
set-multiple

Set left, right, top and bottom properties
font

Font
[.huxtable

Subset a huxtable
print.huxtable

Default print method for huxtables
left_padding

Cell padding
rowspecs

Different ways to select rows and columns
set_cell_properties

Set multiple cell properties
final

Return the last n rows or columns
mapping-functions

How to set cell properties variably by cell contents
quick-output

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

Number format
set_outer_borders

Set borders around a rectangle of cells
tabular_environment

Tabular environment
position

Table position
text_color

Text color
themes

Theme a huxtable
set_contents

Set cell contents
font_size

Font size
t.huxtable

Transpose a huxtable
tidy_override

Override a model's tidy output
print_screen

Print a huxtable on screen
valign

Vertical alignment
hux_logo

Huxtable logo
huxreg

Create a huxtable to display model output
set_default_properties

Default huxtable properties
width

Table width
knit_print.huxtable

Print a huxtable within knitr
label

Table label
wrap

Text wrapping
reexports

Objects exported from other packages
report_latex_dependencies

Tools for LaTeX dependencies
print_md

Create Markdown representing a huxtable
print_rtf

Create RTF representing a huxtable
jams

Prices of 3 jams
knit_print.data.frame

Print data frames in knitr using huxtable
latex_float

Float position for LaTeX
left_border

Borders
rtf_fc_tables

Create RTF font and color tables
sanitize

Escape text for various formats
print_html

Create HTML representing a huxtable
print_latex

Create LaTeX representing a huxtable
by_regex

Map cells matching a string or regex to cell properties
align

Alignment