display_val_frmts {tfrmt} | R Documentation |
Display formatted values
Description
A helper for creating positional-alignment specifications for the col_style_plan. Returns all unique formatted values to appear in the column(s) specified. Numeric values are represented by x's.
Usage
display_val_frmts(tfrmt, .data, mock = FALSE, col = NULL)
Arguments
tfrmt |
tfrmt object to apply to the data |
.data |
Data to apply the tfrmt to |
mock |
Mock table? TRUE or FALSE (default) |
col |
Column value to align on from |
Value
text representing character vector of formatted values to be copied and modified in the col_style_plan
Examples
tf_spec <- tfrmt(
group = c(rowlbl1,grp),
label = rowlbl2,
column = column,
param = param,
value = value,
sorting_cols = c(ord1, ord2),
body_plan = body_plan(
frmt_structure(group_val = ".default", label_val = ".default", frmt_combine("{n} ({pct} %)",
n = frmt("xxx"),
pct = frmt("xx.x"))),
frmt_structure(group_val = ".default", label_val = "n", frmt("xxx")),
frmt_structure(group_val = ".default", label_val = c("Mean", "Median", "Min","Max"),
frmt("xxx.x")),
frmt_structure(group_val = ".default", label_val = "SD", frmt("xxx.xx")),
frmt_structure(group_val = ".default", label_val = ".default",
p = frmt_when(">0.99" ~ ">0.99",
"<0.15" ~ "<0.15",
TRUE ~ frmt("x.xxx", missing = "")))
))
display_val_frmts(tf_spec, data_demog, col = vars(everything()))
display_val_frmts(tf_spec, data_demog, col = "p-value")
[Package tfrmt version 0.1.2 Index]