huxtable-package: Quick introduction to huxtable

huxtable-packageR Documentation

Quick introduction to huxtable

Description

Huxtable is a package for creating HTML and LaTeX tables. It provides similar functionality to xtable, with a simpler interface.

Quick start

To create a huxtable object, use huxtable() or as_huxtable():

 library(huxtable)
 employees <- huxtable(
         Names    = c("Hadley", "Yihui", "Dirk"),
         Salaries = c(1e5, 1e5, 1e5),
         add_colnames = TRUE
       )
 car_hux <- as_hux(mtcars)

You can then set properties which affect how the huxtable is displayed:

 # make the first row bold:
 bold(employees)[1, ] <- TRUE

 # change the font size everywhere:
 font_size(employees) <- 10

Or you can use a tidyverse style with the pipe operator:

library(magrittr)
employees <- employees %>%
      set_font_size(10) %>%
      set_bold(1, everywhere, TRUE)

For more information, see the website or read the vignette with vignette("huxtable").

See huxtable-FAQ for frequently asked questions, including ways to get help.

To report a bug, or suggest an enhancement, visit github.

Author(s)

Maintainer: David Hugh-Jones davidhughjones@gmail.com

See Also

Useful links:


huxtable documentation built on Oct. 2, 2024, 1:06 a.m.