Every apa_inline() method returns an apabayes_results object: the
strings for the running text next to the numbers they were made from.
It has the four elements papaja's apa_results has, and inherits that
class, so papaja::apa_table() accepts it.
Usage
is_apa_results(x)
# S3 method for class 'apabayes_results'
print(x, ...)
# S3 method for class 'apabayes_results'
format(x, ...)
# S3 method for class 'apabayes_results'
as.character(x, ...)
# S3 method for class 'apabayes_results'
knit_print(x, ..., inline = FALSE)Value
is_apa_results() returns a logical scalar; format() and
as.character() return full_result; print() returns x
invisibly.
Elements
estimatecharacter; the estimate with its interval, one per reported row (
*b* = 0.31, 95% CrI [0.12, 0.50]), or one for the whole table when the string describes all of it, asapa_convergence()'s does.NAfor a table kind that has no estimate.statisticcharacter; the statistics that follow it (
*pd* > .999), orNAwhen the row carries none.full_resultcharacter; the two joined with a comma, which is what prints.
tablethe reported rows, as an apabayes_tidy table with its attributes.
markupthe markup target the strings were written for.
papaja::apa_print() on an apabayes object returns the three string
elements as named lists instead, one element per row (see
apabayes-papaja); print() then writes each string after its name.
In a document
Inline code such as `r apa_inline(fit, "wt")` prints
full_result through a knit_print method; no $full_result is
needed. print(), format() and as.character() return the same
string at the console.
Examples
t <- apabayes_tidy(
data.frame(
term = "b_wt", estimate = -5.34, ci_low = -6.85,
ci_high = -3.82, pd = 0.9995, component = "conditional"
),
type = "parameters", centrality = "median", ci_method = "eti",
ci_level = 0.95
)
r <- apa_inline(t, "b_wt")
r
#> *b* = −5.34, 95% CrI [−6.85, −3.82], *pd* > .999
is_apa_results(r)
#> [1] TRUE
r$estimate
#> [1] "*b* = −5.34, 95% CrI [−6.85, −3.82]"
r$statistic
#> [1] "*pd* > .999"
