as_kable.tablet: Coerce Tablet to Kable

Description Usage Arguments Value Examples

Description

Renders a tablet. Calls kbl and implements special features like grouped columns.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## S3 method for class 'tablet'
as_kable(
  x,
  ...,
  booktabs = TRUE,
  escape = FALSE,
  escape_latex = tablet::escape_latex,
  escape_html = function(x, ...) x,
  variable = " ",
  col.names = NA,
  linebreak = TRUE,
  align = "c",
  double_escape = FALSE,
  linebreaker = "\n",
  pack_rows = list()
)

Arguments

x

tablet

...

passed to kbl

booktabs

passed to kbl

escape

passed to kbl; defaults FALSE to allow header linebreaks

escape_latex

a function to pre-process column names and content if 'escape' is FALSE (e.g., manual escaping, latex only)

escape_html

a function to pre-process column names content if 'escape' is FALSE (e.g., manual escaping, html only)

variable

a column name for the variables

col.names

passed to kbl after any linebreaking

linebreak

whether to invoke linebreak for column names

align

passed to linebreak for column names

double_escape

passed to linebreak for column names

linebreaker

passed to linebreak for column names in latex; for html, newline is replaced with <br>

pack_rows

named list passed to pack_rows for finer control of variable names

Value

like kbl

Examples

1
2
3
4
5
6
7
8
9
library(boot)
library(dplyr)
library(magrittr)
melanoma %>%
  select(-time, -year) %>%
  mutate(sex = factor(sex), ulcer = factor(ulcer)) %>%
  group_by(status) %>%
  tablet %>%
  as_kable

tablet documentation built on Aug. 21, 2021, 9:07 a.m.