quick_kable: Quick Kable

Description Usage Arguments Value Examples

View source: R/tables.R

Description

Create table with default settings for kableExtra::kable() function. Produces table in R Markdown.

Usage

1
2
3
4
5
6
7
quick_kable(
  df,
  p_digits = 3,
  p_format = "html",
  lab_title = "",
  col_names = NULL
)

Arguments

df

Dataframe to be converted to table.

p_digits

Numeric for maximum number of digits to round numeric values.

p_format

Character string. Possible values are latex, html, markdown, pandoc, and rst; this will be automatically determined if the function is called within knitr; it can also be set in the global option knitr.table.format. If format is a function, it must return a character string.

lab_title

Character for table title.

col_names

Character for column names. Must have the same length as the number of columns in the dataframe.

Value

The table ready for output in R Markdown.

Examples

1
2
3
4
5
6
quick_kable(iris)
quick_kable(
    iris,
    lab_title = "Cool HTML Table of Iris Data",
    col_names = c("S Length", "S Width", "P Length", "P Width", "Species")
    )

dgrisafe/styledom documentation built on April 9, 2021, 5:44 a.m.