Builds a simtab_style object: the single specification that controls both the
text conventions of a table (how counts, percentages, confidence intervals and
p-values are written) and its visual flextable theme. Pass the result to the
style argument of table1(), or register it under a name with
register_journal() so it can be referred to as style = "myjournal".
Usage
journal_style(
np_template = NULL,
count_header = "n (%)",
digits_cont = 1,
digits_est = 2,
ci_sep = " - ",
ci_parens = "()",
est_template = NULL,
pval_thresh = 0.001,
pval_digits = 3,
pval_upper = NULL,
pval_leading_zero = TRUE,
pval_adaptive = FALSE,
percent_sign = TRUE,
flex = NULL
)Arguments
- np_template
Character template for a categorical "count (percent)" cell, using
{n}and{p}placeholders. IfNULL, derived frompercent_sign("{n} ({p}%)"or"{n} ({p})").- count_header
Character appended to categorical variable headers to note the cell convention, e.g.
"n (%)"or"No. (%)".- digits_cont
Integer decimals for continuous summaries. Default
1.- digits_est
Integer decimals for effect-measure estimates. Default
2.- ci_sep
Character separating confidence-interval bounds (and IQR bounds), e.g.
" - ","\u2013"," to ". Default" - ".- ci_parens
Two characters wrapping the confidence interval, e.g.
"()"or"[]". Default"()".- est_template
Character template for an estimate-with-CI string, using
{est},{lower},{upper},{sep}and the bracket placeholders{lp}/{rp}. IfNULL,"{est} {lp}{lower}{sep}{upper}{rp}".- pval_thresh
Numeric; p-values below this print as
"<thresh". Default0.001.- pval_digits
Integer decimals for p-values. Default
3.- pval_upper
Optional numeric ceiling; p-values above this print as
">upper". DefaultNULL.- pval_leading_zero
Logical; whether p-values keep a leading zero before the decimal point. Default
TRUE.- pval_adaptive
Logical; whether p-values above
0.01use two decimals and smaller p-values usepval_digits. DefaultFALSE.- percent_sign
Logical; whether the default
np_templateincludes a%. Ignored whennp_templateis supplied. DefaultTRUE.- flex
A function of one argument
function(ft) ...that styles and returns a flextable, applied byas_flextable()on atable1result. IfNULL, the SimtablR house theme (booktabs styling).