Learn R Programming

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

Huxtable is an R package for creating HTML and LaTeX tables. It provides similar functionality to xtable, but does more, with a simpler 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 or Powerpoint using the officer and openxlsx packages.
  • Quick one-liners to print data frames into a new PDF, HTML page 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

14,405

Version

4.2.1

License

MIT + file LICENSE

Maintainer

David Hugh-Jones

Last Published

October 26th, 2018

Functions in huxtable (4.2.1)

add_rows

Insert one matrix into another.
col_width

Column widths
mutate.huxtable

Dplyr verbs for huxtable
pad_decimal

Deprecated functions
huxtable-options

Package options
knit_print.huxtable

Print a huxtable within knitr
label

Table label
quick-output

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

Convert a huxtable for Excel
as_huxtable

Convert objects to huxtables
as_FlexTable

Convert a huxtable for Word/Powerpoint
font

Font
background_color

Background color
font_size

Font size
report_latex_dependencies

Tools for LaTeX dependencies
hux_logo

Huxtable logo
huxreg

Create a huxtable to display model output
print_latex

Create LaTeX representing a huxtable
print_md

Create Markdown representing a huxtable
set-multiple

Set left, right, top and bottom properties
escape_contents

Escape cell contents
set_cell_properties

Set multiple cell properties
every

Return every n row or column numbers
caption

Caption
bold

Cell text style
caption_pos

Caption position
cbind.huxtable

Combine rows or columns
insert_column

Insert a row or column
add_colnames

Add column or row names
add_footnote

Add a row with a footnote
knit_print.data.frame

Print data frames in knitr using huxtable
merge_cells

Merge a range of cells
left_padding

Cell padding
rotation

Text rotation
height

Table height
guess_knitr_output_format

Guess knitr output format
left_border_color

Border colors
left_border_style

Border styles
set_default_properties

Default huxtable properties
t.huxtable

Transpose a huxtable
row_height

Row heights
rtf_fc_tables

Create RTF font and color tables
latex_float

Float position for LaTeX
sanitize

Escape text for various formats
[.huxtable

Subset a huxtable
left_border

Borders
print_rtf

Create RTF representing a huxtable
final

Return the last n rows or columns
rowspan

Row and column span
print_screen

Print a huxtable on screen
huxtable-package

Huxtable: simply create LaTeX and HTML tables
huxtable

Create a huxtable
rowspecs

Different ways to select rows and columns
themes

Theme a huxtable
print_html

Create HTML representing a huxtable
na_string

NA string
valign

Vertical alignment
where

Return array indices where expression is true
number_format

Number format
position

Table position
print.huxtable

Default print method for huxtables
tabular_environment

Tabular environment
text_color

Text color
width

Table width
wrap

Text wrapping
align

Alignment