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.
  • huxreg() function for quick creation of regression tables.
  • Output to Microsoft Word or Powerpoint using the officer package.
  • quick_pdf(), quick_docx() and quick_html() one-liners to print data frames into a new 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

3.0.0

License

MIT + file LICENSE

Maintainer

David Hugh-Jones

Last Published

February 23rd, 2018

Functions in huxtable (3.0.0)

as_FlexTable

Convert a huxtable for Word/Powerpoint
huxtable

Create a huxtable
insert_column

Insert a row or column
bold

Cell text style
caption

Caption
font_size

Font size
font

Font
left_padding

Cell padding
left_border_color

Border colors
set_cell_properties

Set multiple cell properties
is_a_number

Does an object look like a number?
set_default_properties

Set default huxtable properties
set_outer_borders

Set outer borders round a rectangle of cells
label

Table label
t.huxtable

Transpose a huxtable
align

Alignment
latex_float

Float position for LaTeX
caption_pos

Caption position
as_Workbook

Convert a huxtable for Excel
left_border

Borders
every

Return every n row or column numbers
cbind.huxtable

Combine rows or columns
[.huxtable

Subset a huxtable
rowspecs

Row and column specifications
filter

Pointless documentation
final

Return the last n rows or columns
huxreg

Create a huxtable to display model output
sanitize

Sanitize table elements
add_colnames

Add column or row names
add_footnote

Add a row with a footnote
mutate.huxtable

Dplyr verbs for huxtable
escape_contents

Escape cell contents
get_default_properties

Get default huxtable properties
themes

Theme a huxtable
guess_knitr_output_format

Guess knitr output format
huxtable-package

Huxtable: simply create LaTeX and HTML tables
pad_decimal

Decimal padding
na_string

NA string
number_format

Number format
print_html

Create HTML representing a huxtable
wrap

Text wrapping
height

Table height
hux_logo

Huxtable logo
position

Table position
set_all_border_colors

Set all border colors
row_height

Row heights
rowspan

Row span
set_all_borders

Set all borders
print_latex

Create LaTeX representing a huxtable
where

Return array indices where expression is true
width

Table width
print_md

Create Markdown representing a huxtable
text_color

Text color
report_latex_dependencies

Report LaTeX dependencies
print.huxtable

Default print method for huxtables
rotation

Text rotation
quick-output

Quickly create a PDF, HTML, Word or Excel document showing matrices, data frames, et cetera.
tabular_environment

Tabular environment
print_screen

Print a huxtable on screen
valign

Vertical alignment
col_width

Column widths
background_color

Background color
colspan

Column span