print_mean_sd {prmisc} | R Documentation |
Print mean and standard deviation
Description
Print mean and standard deviation
Usage
print_mean_sd(
x,
decimals_M = 2,
decimals_SD = 2,
parentheses = TRUE,
short = FALSE,
na.rm = FALSE
)
Arguments
x |
a vector of the sample the statistics should be printed for. |
decimals_M |
how many decimals should be printed for the mean (defaults to 2). |
decimals_SD |
how many decimals should be printed for the standard deviation (defaults to 2). |
parentheses |
logical indicating if the statistics should be
wrapped in parentheses or not (defaults to
|
short |
logical indicating if a short version without the letters
should be printed. Argument |
na.rm |
logical indicating whether missing values should be
ignored or not. Defaults to |
Details
The following formatting options are available:
When
parentheses
isTRUE
:(M = XX, SD = XX)
When
parentheses
isFALSE
:M = XX, SD = XX
When
short
isTRUE
:XX (XX)
Value
A string with information on mean and standard deviation in x
.
Author(s)
Juliane Nagel juliane.nagel@zi-mannheim.de
Examples
print_mean_sd(rnorm(100, 0, 1))
print_mean_sd(1:20, decimals_M = 0, decimals_SD = 3)
print_mean_sd(c(2, 10, 12.5, 3), parentheses = FALSE)