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,405

Version

4.0.0

License

MIT + file LICENSE

Maintainer

David Hugh-Jones

Last Published

June 2nd, 2018

Functions in huxtable (4.0.0)

filter

Pointless documentation
get_default_properties

Get default huxtable properties
is_a_number

Does an object look like a number?
huxtable-package

Huxtable: simply create LaTeX and HTML tables
left_padding

Cell padding
set_cell_properties

Set multiple cell properties
guess_knitr_output_format

Guess knitr output format
knit_print.huxtable

Print a huxtable within knitr
huxreg

Create a huxtable to display model output
print_html

Create HTML representing a huxtable
set_all_borders

Set all borders
left_border_color

Border colors
hux_logo

Huxtable logo
number_format

Number format
text_color

Text color
valign

Vertical alignment
print_latex

Create LaTeX representing a huxtable
set_all_border_colors

Set all border colors
na_string

NA string
sanitize

Sanitize table elements
knit_print.data.frame

Print data frames in knitr using huxtable
label

Table label
final

Return the last n rows or columns
huxtable

Create a huxtable
themes

Theme a huxtable
row_height

Row heights
position

Table position
rotation

Text rotation
print_md

Create Markdown representing a huxtable
where

Return array indices where expression is true
latex_float

Float position for LaTeX
insert_column

Insert a row or column
width

Table width
print.huxtable

Default print method for huxtables
left_border

Borders
print_screen

Print a huxtable on screen
quick-output

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

Text wrapping
rowspan

Row span
rowspecs

Row and column specifications
set_outer_borders

Set outer borders round a rectangle of cells
report_latex_dependencies

Report LaTeX dependencies
t.huxtable

Transpose a huxtable
tabular_environment

Tabular environment
set_default_properties

Set default huxtable properties
align

Alignment
caption_pos

Caption position
cbind.huxtable

Combine rows or columns
bold

Cell text style
as_FlexTable

Convert a huxtable for Word/Powerpoint
background_color

Background color
add_colnames

Add column or row names
as_Workbook

Convert a huxtable for Excel
[.huxtable

Subset a huxtable
every

Return every n row or column numbers
mutate.huxtable

Dplyr verbs for huxtable
add_footnote

Add a row with a footnote
font_size

Font size
escape_contents

Escape cell contents
caption

Caption
col_width

Column widths
font

Font
colspan

Column span
height

Table height