format_SPSS {r2spss} | R Documentation |
Format Objects
Description
Format an object for printing, mostly used to print numeric data in the same
way as SPSS. This is mainly for internal use in to_SPSS
and
print
methods.
Usage
format_SPSS(object, ...)
## Default S3 method:
format_SPSS(object, ...)
## S3 method for class 'integer'
format_SPSS(object, ...)
## S3 method for class 'numeric'
format_SPSS(object, digits = 3, p_value = FALSE, check_int = FALSE, ...)
## S3 method for class 'matrix'
format_SPSS(object, digits = 3, p_value = FALSE, check_int = FALSE, ...)
## S3 method for class 'data.frame'
format_SPSS(object, digits = 3, p_value = FALSE, check_int = FALSE, ...)
formatSPSS(object, ...)
Arguments
object |
an R object. Currently methods are implemented
for vectors, matrices, and data frames. The default method calls
|
... |
additional arguments passed down to methods. |
digits |
an integer giving the number of digits after the comma to display. |
p_value |
a logical indicating whether small positive values should be
indicated as below the threshold defined by |
check_int |
a logical indicating whether to check for integer values
and format them as such, e.g., to format the integer |
Value
A character vector, matrix, or data frame containing the formatted object.
Author(s)
Andreas Alfons
Examples
# note how numbers in the interval (-1, 1) are printed
# without the zero in front of the comma
format_SPSS(c(-1.5, -2/3, 2/3, 1.5))