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

10,978

Version

4.2.0

License

MIT + file LICENSE

Maintainer

David Hugh-Jones

Last Published

October 3rd, 2018

Functions in huxtable (4.2.0)

escape_contents

Escape cell contents
as_FlexTable

Convert a huxtable for Word/Powerpoint
na_string

NA string
height

Table height
print.huxtable

Default print method for huxtables
position

Table position
number_format

Number format
col_width

Column widths
mutate.huxtable

Dplyr verbs for huxtable
guess_knitr_output_format

Guess knitr output format
caption_pos

Caption position
every

Return every n row or column numbers
cbind.huxtable

Combine rows or columns
huxtable-options

Package options
pad_decimal

Deprecated functions
latex_float

Float position for LaTeX
[.huxtable

Subset a huxtable
huxtable-package

Huxtable: simply create LaTeX and HTML tables
huxtable

Create a huxtable
hux_logo

Huxtable logo
font

Font
huxreg

Create a huxtable to display model output
merge_cells

Merge a range of cells
font_size

Font size
left_padding

Cell padding
final

Return the last n rows or columns
insert_column

Insert a row or column
left_border

Borders
knit_print.huxtable

Print a huxtable within knitr
label

Table label
rowspan

Row and column span
set-multiple

Set left, right, top and bottom properties
rowspecs

Different ways to select rows and columns
text_color

Text color
tabular_environment

Tabular environment
knit_print.data.frame

Print data frames in knitr using huxtable
set_cell_properties

Set multiple cell properties
rtf_fc_tables

Create RTF font and color tables
sanitize

Escape text for various formats
quick-output

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

Border colors
left_border_style

Border styles
rotation

Text rotation
report_latex_dependencies

Tools for LaTeX dependencies
row_height

Row heights
themes

Theme a huxtable
print_html

Create HTML representing a huxtable
print_latex

Create LaTeX representing a huxtable
print_rtf

Create RTF representing a huxtable
width

Table width
wrap

Text wrapping
print_md

Create Markdown representing a huxtable
set_default_properties

Default huxtable properties
print_screen

Print a huxtable on screen
t.huxtable

Transpose a huxtable
valign

Vertical alignment
where

Return array indices where expression is true
as_huxtable

Convert objects to huxtables
bold

Cell text style
caption

Caption
as_Workbook

Convert a huxtable for Excel
add_rows

Insert one matrix into another.
align

Alignment
add_colnames

Add column or row names
background_color

Background color
add_footnote

Add a row with a footnote