strMeanSd: Format means and standard deviations

Description Usage Arguments Value Author(s) Examples

View source: R/strMeanSd.R

Description

Very simple function to compute the mean and the standard deviation of a vector of numbers and format them as mean (standard deviation). The number of digits to be kept could be set for the mean and the standard deviation.

Usage

1
strMeanSd(x, dmean = 2, dsd = 1)

Arguments

x

A vector of numbers.

dmean

Optional, the number of digits to use in rounding the mean. Default to 2.

dsd

Optional, the number of digits to use in rounding the standard deviation. Default to 1.

Value

Return a string formatted as mean (standard deviation).

Author(s)

Guillaume T. Vallet gtvallet@gmail.com, University of Montreal (Canada)

Examples

1
2
age = c(18, 19, 22, 19, 26, 23, 18, 20, 22, 19)
strMeanSd(age)

Cogitos/predata documentation built on May 6, 2019, 12:21 p.m.