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_pdf(), quick_docx(), quick_html() and quick_xlsx() 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

14,138

Version

4.0.1

License

MIT + file LICENSE

Maintainer

David Hugh-Jones

Last Published

July 3rd, 2018

Functions in huxtable (4.0.1)

insert_column

Insert a row or column
colspan

Column span
escape_contents

Escape cell contents
na_string

NA string
is_a_number

Does an object look like a number?
set_cell_properties

Set multiple cell properties
set_all_borders

Set all borders
huxtable

Create a huxtable
valign

Vertical alignment
knit_print.data.frame

Print data frames in knitr using huxtable
number_format

Number format
get_default_properties

Get default huxtable properties
huxtable-package

Huxtable: simply create LaTeX and HTML tables
huxreg

Create a huxtable to display model output
text_color

Text color
themes

Theme a huxtable
where

Return array indices where expression is true
height

Table height
latex_float

Float position for LaTeX
hux_logo

Huxtable logo
left_border_color

Border colors
guess_knitr_output_format

Guess knitr output format
row_height

Row heights
position

Table position
rotation

Text rotation
t.huxtable

Transpose a huxtable
knit_print.huxtable

Print a huxtable within knitr
label

Table label
left_padding

Cell padding
left_border

Borders
print_screen

Print a huxtable on screen
print.huxtable

Default print method for huxtables
tabular_environment

Tabular environment
rowspecs

Row and column specifications
print_md

Create Markdown representing a huxtable
rowspan

Row span
width

Table width
quick-output

Quickly print objects to a PDF, HTML, Word or Excel document.
report_latex_dependencies

Report LaTeX dependencies
set_default_properties

Set default huxtable properties
wrap

Text wrapping
sanitize

Sanitize table elements
print_latex

Create LaTeX representing a huxtable
set_all_border_colors

Set all border colors
print_html

Create HTML representing a huxtable
set_outer_borders

Set outer borders round a rectangle of cells
cbind.huxtable

Combine rows or columns
bold

Cell text style
as_FlexTable

Convert a huxtable for Word/Powerpoint
add_colnames

Add column or row names
caption

Caption
as_Workbook

Convert a huxtable for Excel
filter

Pointless documentation
align

Alignment
col_width

Column widths
add_footnote

Add a row with a footnote
final

Return the last n rows or columns
caption_pos

Caption position
background_color

Background color
every

Return every n row or column numbers
font_size

Font size
mutate.huxtable

Dplyr verbs for huxtable
font

Font
[.huxtable

Subset a huxtable