R/helpers_miscellaneous.R
expr_template.Rd
Template for subtitles with statistical details for tests
expr_template( no.parameters, statistic.text, stats.df, effsize.text, n, conf.level = 0.95, k = 2L, k.parameter = 0L, k.parameter2 = 0L, n.text = NULL, ... )
no.parameters  An integer that specifies that the number of parameters
for the statistical test. Can be 

statistic.text  A character that specifies the relevant test statistic.
For example, for tests with tstatistic, 
stats.df  A dataframe containing details from the statistical analysis and should contain some of the the following columns:

effsize.text  A character that specifies the relevant effect size.
For example, for Cohen's d statistic, 
n  An integer specifying the sample size used for the test. 
conf.level  Scalar between 0 and 1. If unspecified, the defaults return

k  Number of digits after decimal point (should be an integer)
(Default: 
k.parameter, k.parameter2  Number of decimal places to display for the
parameters (default: 
n.text  A character that specifies the design, which will determine
what the 
...  Currently ignored. 
set.seed(123) # creating a dataframe with stats results stats_df < cbind.data.frame( statistic = 5.494, parameter = 29.234, p.value = 0.00001, estimate = 1.980, conf.low = 2.873, conf.high = 1.088 ) # subtitle for *t*statistic with Cohen's *d* as effect size statsExpressions::expr_template( no.parameters = 1L, stats.df = stats_df, statistic.text = quote(italic("t")), effsize.text = quote(italic("d")), n = 32L, conf.level = 0.95, k = 3L, k.parameter = 3L )#> paste(italic("t"), "(", "29.234", ") = ", "5.494", ", ", italic("p"), #> " = ", "1e05", ", ", italic("d"), " = ", "1.980", ", CI"["95%"], #> " [", "2.873", ", ", "1.088", "]", ", ", italic("n"), " = ", #> 32L)