View source: R/continuous_table.R
pt_cont_wide | R Documentation |
This function summarizes your data in a specific way and returns an object
that can be converted into a latex
table.
pt_cont_wide(
data,
cols,
by = ".total",
panel = by,
table = NULL,
units = NULL,
digits = new_digits(),
all_name = "All data",
fun = cont_wide_fun,
na_fill = "--",
id_col = "ID"
)
data |
the data frame to summarize; the user should filter or subset
so that |
cols |
the columns to summarize; may be character vector or quosure |
by |
a grouping variable; may be character vector or quosure |
panel |
data set column name to stratify the summary |
table |
a named list to use for renaming columns (see details and examples) |
units |
a named list to use for unit lookup (see details and examples) |
digits |
a |
all_name |
a name to use for the complete data summary |
fun |
the data summary function (see details) |
na_fill |
value to fill with when all values in the summary are missing |
id_col |
the ID column name |
The default summary function is cont_wide_fun()
. Please review that
documentation for details on the default summary for this table.
The notes for this table are generated by pt_cont_wide_notes()
.
An object with class pmtable
; see class-pmtable.
The summary function (fun
) should take value
as the first argument and
return a data frame or tibble with one row and one column named summary
.
The function can also accept an id
argument which is a vector of IDs
that is the same length as value
. Be sure to include ...
to the function
signature as other arguments will be passed along. Make sure your function
completely formats the output ... it will appear in the table as you return
from this function. See cont_wide_fun()
for details on the default
implementation.
pmtables:::cont_wide_fun(rnorm(100))
out <- stable(pt_cont_wide(pmt_first, cols = "AGE,WT,SCR"))
out
## Not run:
st2report(out)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.