Learn R Programming

pubprint (version 0.2.1)

style.apa.numeric: Formats a numeric vector

Description

This style functions takes a numeric vector in a list and returns a formatted numeric vector. Additional arguments can be given specifying how to format the numeric vector.

Usage

style.apa.numeric(x, name, inbracket, nsmall = pp_opts$get("nsmall"), replace0 = FALSE, leading0 = TRUE, ...)

Arguments

x
a list. First list item has to be a numeric vector. All other items are ignored.
name
a character. Giving the identifier name of the numeric (like in x = 12).
inbracket
a character. Giving additional information after the identifier, like a degree of freedom (e.g. t(12) = 3.42).
nsmall
a integer. The minimum number of digits to the right of the decimal point in formatting real/complex numbers in non-scientific formats.
replace0
a boolean. Controls whether numbers that are absolute smaller than 1/(10^nsmall) are replaced with this term. For example $p = .0001$ with $p < .001$. Pay attention that zero is replaced as well.
leading0
a boolean, specifying whether a zero before the decimal point is printed.
...
further arguments passed to format.

Value

numeric vector.

Details

Please note that this is a internal style function. It is called from pprint and not exported to user namespace. Usually pprint determines the correct style function automatically, but you can define the style function by using the format argument of pprint (pass the name of this function without style.apa. prefix). Additionally you can pass the arguments listed in this documentation to pprint.

Argument x of this function expects a list. Be aware that you do not have to pass a list to pprint or pull.pubprint -- these functions will convert your arguments. This is only necessary if you want to pass additionally information to the internal style functions (see vignette for examples).

See Also

Other APA.style.functions: style.apa.anova, style.apa.bartlett, style.apa.character, style.apa.chisq, style.apa.cor.test, style.apa.df, style.apa.fisher, style.apa.ks, style.apa.p.value, style.apa.shapiro, style.apa.summary.aovlist, style.apa.summary.lm.beta.coeff, style.apa.summary.lm.coeff, style.apa.summary.lm.equation, style.apa.summary.lm.model, style.apa.t.test

Examples

Run this code
pprint(c(.74895, 13.1234567), format = "numeric")

Run the code above in your browser using DataLab