apa_num | R Documentation |
Converts numerical values to character strings for printing and reporting.
apa_num(x, ...)
printnum(x, ...)
print_num(x, ...)
## Default S3 method:
apa_num(x, na_string = getOption("papaja.na_string"), ...)
## S3 method for class 'list'
apa_num(x, ...)
## S3 method for class 'integer'
apa_num(
x,
numerals = TRUE,
capitalize = FALSE,
zero_string = "no",
na_string = getOption("papaja.na_string"),
...
)
## S3 method for class 'numeric'
apa_num(
x,
gt1 = TRUE,
zero = TRUE,
na_string = getOption("papaja.na_string"),
use_math = TRUE,
add_equals = FALSE,
...
)
## S3 method for class 'data.frame'
apa_num(x, margin = 2, ...)
## S3 method for class 'matrix'
apa_num(x, margin = 2, ...)
## S3 method for class 'tiny_labelled'
apa_num(x, ...)
x |
Can be either a single value, vector, |
... |
Arguments passed on to
|
na_string |
Character. String to print if any element of |
numerals |
Logical. Indicates if integers should be converted to words. |
capitalize |
Logical. Indicates if first letter should be capitalized.
Ignored if |
zero_string |
Character. Word to print if |
gt1 |
Logical. Indicates if the statistic can, in principle, have an
absolute value greater than 1. If |
zero |
Logical. Indicates if the statistic can, in principle, be 0. If
|
use_math |
Logical. Indicates whether to use |
add_equals |
Logical. Indicates if the output string should be
prepended with an |
margin |
Integer. If |
If x
is a vector, all arguments can be vectors according to which each
element of the vector is formatted. Parameters are recycled if length of
x
exceeds the length of the parameter vectors. If x
is a matrix
or
data.frame
, the vectors specify the formatting of either rows or columns
according to the value of margin
.
We recommend to use apa_num()
, rather than printnum()
or print_num()
,
which are aliases kept only for backward compatibility.
An object of the same class as x
with all numeric values converted
to character.
apa_p()
, apa_df()
apa_num(1/3)
apa_num(1/3, gt1 = FALSE)
apa_num(1/3, digits = 5)
apa_num(0)
apa_num(0, zero = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.