mean_sd: Compute the mean and standard deviation of a vector,...

View source: R/descriptives.R

mean_sdR Documentation

Compute the mean and standard deviation of a vector, returning a formatted string containing the values as 'M +/- SD'

Description

Compute the mean and standard deviation of a vector, returning a formatted string containing the values as 'M +/- SD'

Usage

mean_sd(
  x = NULL,
  MoreArgs = NULL,
  give_df = TRUE,
  ...,
  mean_x = NULL,
  sd_x = NULL
)

## Default S3 method:
mean_sd(
  x = NULL,
  MoreArgs = NULL,
  give_df = TRUE,
  ...,
  mean_x = NULL,
  sd_x = NULL
)

## S3 method for class 'data.frame'
mean_sd(
  x = NULL,
  MoreArgs = NULL,
  give_df = TRUE,
  ...,
  mean_x = NULL,
  sd_x = NULL
)

Arguments

x

numeric vector of values to summarize

MoreArgs

named list of arguments to pass to mean and sd

give_df

logical. Should mean, sd, and summary string be returned in a data frame?

...

additional arguments passed to format

mean_x

an already-calculated mean value for x

sd_x

an already-calculated sd value for x

Examples

mean_sd(rnorm(100, 50))


paulhibbing/PAutilities documentation built on Sept. 12, 2022, 1:46 a.m.