Skip to contents

Create flextables

Convert objects to flextables

apa_flextable()
Convert data to flextable consistent with APA style
apa_chisq()
Make contingency table with chi-square test of independence
apa_cor()
APA-formatted correlation table
apa_loadings()
print loadings
apa_parameters()
format model parameters in APA style
apa_performance()
format model performance metrics in APA style
apa_performance_comparison()
format model comparison metrics in APA style

Style flextables

Alter the look of a flextable previously created

apa_style()
Style flextable::flextable object according to APA style
pretty_widths()
Use flextable::dim_pretty to fit column widths

Variable Formatters

Alter vector variables

align_chr()
Align text on center text (default is decimal)
apa_p()
p-value in APA format
hanging_indent()
Return markdown text with hanging indent
num_pad()
Pads text on the left or right so that the width is the same for each element of the vector
p2stars()
Convert p-values to stars
star_balance()
Prefix text with figure spaces to balance star text
tagger() bold_md() italic_md() superscript_md() subscript_md() header_md()
Surrounds text with tags unless empty

Automatic formatting

Customize how column_headers and data are formatted by apa_styleandapa_flextable`

apa7_defaults()
Set defaults for apa7 package
column_format()
Column format class
column_formats()
Create a set of column formats

Alter data.frame

Change data.frames

apa_format_columns()
Format data columns
column_spanner_label()
Prepend column spanner labels to data column labels
pivot_wider_name_first()
A wrapper for tidyr::pivot_wider that creates columns names as name_variable instead of variable_name

Create Special Columns

Adding specialized columns that are formatted differently by apa_style and apa_flextable

add_break_columns()
Add break columns
add_list_column()
Make a column into a list column
add_star_column()
Adds stars next to a column based on p-values
separate_star_column()
Add columns that separate significance stars from numbers

Quarto

Functions for creating apaquarto documents

install_apaquarto()
Installs the apaquarto extension.
make_apaquarto()
Run shiny app to make a document in APA style via Quarto

Misc

Other Functions

apa_p_star_note()
Make star notes for p-values
is_numeric_like()
Tests if a character vector contains numeric-like values
str_wrap_equal()
Like stringr::str_wrap, but attempts to create lines of equal width