| apa7_defaults | R Documentation |
Sets options that apply to all apa7 tables. Settings that are not given are left as they are.
apa7_defaults(
accuracy = NULL,
font_family = NULL,
font_size = NULL,
line_spacing = NULL,
intercept_text = NULL,
column_formats = NULL,
number_formatter = NULL,
trim_leading_zero = NULL,
width_aware_padding = NULL,
page_width = NULL,
landscape_width = NULL,
column_width = NULL,
table_width = NULL,
print = NULL,
citations = NULL,
reset = FALSE
)
accuracy |
rounding accuracy of numbers in tables (default: .01, for
two decimals). Model tables such as |
font_family |
font family |
font_size |
font size of tables and their notes, in points (default: 12) |
line_spacing |
spacing between the lines of tables' headers and bodies: 2 (default) for double spacing, 1.5, or 1 for single spacing. APA style allows any of these in tables. Table notes are always single-spaced. |
intercept_text |
label of the intercept row in regression tables (default: |
column_formats |
a |
number_formatter |
function that formats numbers that can exceed 1 in absolute value (e.g., coefficients, standard errors, and test statistics). It takes a numeric vector and |
trim_leading_zero |
function that formats numbers that cannot exceed 1 in absolute value (e.g., correlations, standardized coefficients, and R^2^), which APA style writes without a leading zero. By default, |
width_aware_padding |
if |
page_width |
width of the text area of a portrait page, which tables
fill with |
landscape_width |
width of the text area of a landscape page, in
inches, which tables fill with |
column_width |
width of one column of a two-column page, in inches,
which tables fill with |
table_width |
default width of tables, in any of the forms that the
|
print |
how tables made by apa7 functions (see apa7_tbl) are
displayed: |
citations |
how articles cited in table notes are written: |
reset |
if |
Each setting except column_formats, number_formatter, and
trim_leading_zero is stored as an R option (e.g.,
apa7_defaults(page_width = "a4") sets options(apa7.page_width = "a4")),
so it can also be set with options(), including in an .Rprofile file
that runs at the start of every R session, before apa7 is loaded:
| Argument | Option | Default |
accuracy | apa7.accuracy | .01 |
font_family | apa7.font_family | "Times New Roman" |
font_size | apa7.font_size | 12 |
line_spacing | apa7.line_spacing | 2 |
intercept_text | apa7.intercept_text | "Constant" |
width_aware_padding | apa7.width_aware_padding | TRUE |
page_width | apa7.page_width | 6.5 |
landscape_width | apa7.landscape_width | NA (from page_width) |
column_width | apa7.column_width | NA (from page_width) |
table_width | apa7.table_width | 1 |
print | apa7.print | "auto" |
citations | apa7.citations | "auto" |
column_formats, number_formatter, and trim_leading_zero are objects
that need apa7 to be loaded, so they are set only with apa7_defaults()
and last for the R session.
When page_width and table_width are not set, a Quarto or R Markdown
document being rendered supplies them: its papersize sets the paper, and
apaquarto's documentmode sets the margins (0.75 inches on each side in
journal mode, jou, and 1.5 inches on the left in thesis mode). In
journal mode, which sets the text in two columns, tables are as wide as a
column by default. A setting made with apa7_defaults() or options()
overrides the document.
The default column formats follow accuracy: changing it (with
apa7_defaults() or the apa7.accuracy option) changes the number of
decimals in tables. Setting column_formats without accuracy makes the
formats' own accuracy the accuracy setting.
the previous values of the settings that were changed (all of
them with reset = TRUE), invisibly, as a list that restores them when
passed back to apa7_defaults() (e.g., with do.call())
old <- apa7_defaults(accuracy = .001)
# Tables as wide as the text on A4 paper with 1-inch margins
apa7_defaults(page_width = "a4")
# A two-column document: tables are as wide as a column unless a table
# asks for another width (e.g., table_width = "page" in apa_flextable())
apa7_defaults(table_width = "column")
# Restore the earlier accuracy
do.call(apa7_defaults, old)
# Reset to package defaults
apa7_defaults(reset = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.