papaja (version 0.1.0.9842)

sort_terms: Sort ANOVA or regression table by predictors/effects

Description

Sorts rows in ANOVA or regression tables produced by apa_print by complexity (i.e., main effects, two-way interactions, three-way interactions, etc.).

Usage

sort_terms(x, colname)

Arguments

x

data.frame. For example, a table element produced by apa_print.

colname

Character. Column name of the data.frame containing the terms to sort.

Value

Returns the same data.frame with reordered rows.

Examples

Run this code
# NOT RUN {
## From Venables and Ripley (2002) p. 165.
npk_aov <- aov(yield ~ block + N * P * K, npk)
npk_aov_results <- apa_print(npk_aov)
sort_terms(npk_aov_results$table, "Effect")
# }

Run the code above in your browser using DataLab