meansd: Compute mean and sd and put together with the ± symbol.

Description Usage Arguments Value Examples

View source: R/descriptives.R

Description

Compute mean and sd and put together with the ± symbol.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
meansd(
  x,
  roundDig = 2,
  drop0 = FALSE,
  groupvar = NULL,
  range = FALSE,
  rangesep = " ",
  add_n = FALSE,
  .german = FALSE
)

Arguments

x

Data for computation.

roundDig

Number of relevant digits for roundR.

drop0

Should trailing zeros be dropped?

groupvar

Optional grouping variable for subgroups.

range

Should min and max be included in output?

rangesep

How should min/max be separated from mean+-sd?

add_n

Should n be included in output?

.german

logical, should "." and "," be used as bigmark and decimal?

Value

character vector with mean ± SD, rounded to desired precision

Examples

1
2
3
4
# basic usage of meansd
meansd(x = mtcars$wt)
# with additional options
meansd(x = mtcars$wt, groupvar = mtcars$am, add_n = TRUE)

wrappedtools documentation built on May 8, 2021, 9:06 a.m.