Format a result table's cells as an APA 7 report prints them
Source:R/apa_format.R
sframe_apa_cells.RdThe cells of a table from run_analysis_plan() as both report engines and
sframe_format_result() print them, so a table shows the same numbers wherever it
appears. A p value column shows 3 decimals with the APA 7 form .032, or
<.001. A column bounded by 1, such as r, tau or alpha, uses
its leading zero. Other numbers show 2 decimals, and whole numbers in an
integer column, a column of counts (n, df, Frequency) or a percent column
none. A p value
above .999 shows >.999. A missing value is a blank cell.
Usage
sframe_apa_cells(x, digits = 2)
sframe_apa_col_labels(names, format = c("html", "markdown"), conf_level = 0.95)Details
This is exported because the Quarto report template runs in a separate R session against the installed package.
sframe_apa_col_labels() gives the headings both report engines
print for a table's columns: words for a column such as valid_n
("Valid n"), statistic symbols in italics (M, SD, Mdn, SE) and
the confidence level in an interval heading ("95% CI lower").
Examples
sframe_apa_cells(data.frame(t = 2.345, p = 0.004, r = 0.53, n = 40L))