| sds_table | R Documentation |
Creates HTML or Latex markup with a footnote showing how many rows there are in total.
sds_table(
data,
show_n = 6L,
nrows = nrow(data),
row.names = FALSE,
footnote = NULL,
format = ifelse(knitr::is_latex_output(), "latex", "html"),
caption = NULL,
align = NULL,
in_margin = knitr::opts_current$get("in_margin"),
label = knitr::opts_current$get("label"),
...
)
data |
the data frame to be displayed |
show_n |
how many lines to display (default 6. Use |
nrows |
an integer specifying how many rows the from the data frame should be displayed in the footnote. Set to |
row.names |
whether to show the rownames in the table (def: FALSE) |
footnote |
character string to be placed at the bottom of the table in place of the usual "... and so on for __ rows." |
format |
either |
caption |
string to pass as a caption to the table |
align |
optional column alignment instructions passed to |
in_margin |
If TRUE, format table to go in margin for LaTeX Tufte-style layout. BUT UNFORTUNATELY, THIS WORKS ONLY IN INLINE MODE, while htmlformats DON'T work in inline mode. |
label |
reference label for bookdown, e.g. "my-table" to empower reference with tab:my-table". By default, grabbed from chunk name. |
... |
additional arguments to |
sds_table() can access the knitr chunk label and the value of in_margin. Don't output
the value directly from the chunk. Instead, assign the output of sds_table() to a variable
and use an inline expression to insert that variable.
sds_table(mtcars, "striped", "hover") sds_table(mtcars, show_n = 3, caption="Data about cars")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.