# options("huxtable.knitr_output_format" = "latex") library(huxtable) library(dplyr) knitr::opts_chunk$set(echo = FALSE)
make <- function(nrow = 2, ncol = 2, text1 = 'Some text', text2 = 'Some more text', more_text = 'Some text') { ht <- hux(a = rep(text1, nrow), b = rep(text2, nrow)) for (i in seq_len(ncol -2)) { ht <- cbind(ht, rep(more_text[i], nrow)) } ht <- set_all_borders(ht, 1) ht <- set_background_color(ht, odds, everywhere, 'orange') ht <- set_background_color(ht, evens, everywhere, 'green') ht } long <- 'A rather long row of text which goes on...'
lm_cars <- lm(mpg ~ hp + I(hp^2), data = mtcars) huxreg(lm_cars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.