View source: R/table_bindings.R
header_n | R Documentation |
The 'header_n()' functions can be used to automatically pull the header_n derivations from the table or change them for future use.
header_n(table)
header_n(x) <- value
set_header_n(table, value)
table |
A |
x |
A |
value |
A data.frame with columns with the treatment variable, column variabes, and a variable with counts named 'n'. |
header_n |
A data.frame with columns with the treatment variable, column variabes, and a variable with counts named 'n'. |
The 'header_n' object is created by Tplyr when a table is built and intended to be used by the 'add_column_headers()' function when displaying table level population totals. These methods are intended to be used for calling the population totals calculated by Tplyr, and to overwrite them if a user chooses to.
If you have a need to change the header Ns that appear in your table headers, say you know you are working with a subset of the data that doesn't represent the totals, you can replace the data used with 'set_header_n()'.
For tplyr_header_n
the header_n binding of the
tplyr_table
object. For tplyr_header_n<-
and
set_tplyr_header_n
the modified object.
tab <- tplyr_table(mtcars, gear)
header_n(tab) <- data.frame(
gear = c(3, 4, 5),
n = c(10, 15, 45)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.