View source: R/print_mean_sd.R
print_mean_sd | R Documentation |
Print mean and standard deviation
print_mean_sd(
x,
decimals_M = 2,
decimals_SD = 2,
parentheses = TRUE,
short = FALSE,
na.rm = FALSE
)
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 |
The following formatting options are available:
When parentheses
is TRUE
:
(M = XX, SD = XX)
When parentheses
is FALSE
:
M = XX, SD = XX
When short
is TRUE
: XX (XX)
A string with information on mean and standard deviation in x
.
Juliane Nagel juliane.nagel@zi-mannheim.de
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.