Skip to contents

Calculate mean and sd of a given variable

Usage

mean_sd(data, aim_var, ifunion = FALSE, digits = 2)

Arguments

data

a dataframe

aim_var

user-specified variables, using non-standard input.

ifunion

default FALSE.when ifunite = TRUE,return a character contain mean(sd).

digits

indicating the number of decimal places (round) or significant digits (signif) to be used. For round, negative values are allowed.

Value

`mean_sd` return a data.frame which include two colunms.if `ifunion = true`
retunr a character ,sucn as "mean(sd)".

Examples

if (FALSE) {
data(data_med)
pat_table = data_med$pat %>% calcu_age(.,birthdate)
mead_sd(pat_table,age)
pat %>% mean_sd(age)
pat %>% mean_sd(age,ifunion =TRUE)
}