median_quart: Compute median and quartiles and put together.

View source: R/descriptives.R

median_quartR Documentation

Compute median and quartiles and put together.

Description

Compute median and quartiles and put together.

Usage

median_quart(
  x,
  nround = NULL,
  probs = c(0.25, 0.5, 0.75),
  qtype = 8,
  roundDig = 2,
  drop0 = FALSE,
  groupvar = NULL,
  range = FALSE,
  rangesep = " ",
  rangearrow = " -> ",
  prettynum = FALSE,
  .german = FALSE,
  add_n = FALSE
)

Arguments

x

Data for computation.

nround

Number of digits for fixed round.

probs

Quantiles to compute.

qtype

Type of quantiles.

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?

rangearrow

What is put between min -> max?

prettynum

logical, apply prettyNum to results?

.german

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

add_n

Should n be included in output?

Value

character vector with median [1stQuartile/3rdQuartile], rounded to desired precision

Examples

# basic usage of median_quart
median_quart(x = mtcars$wt)
# with additional options
median_quart(x = mtcars$wt, groupvar = mtcars$am, add_n = TRUE)
data(faketrial)
median_quart(x=faketrial$`Biomarker 1 [units]`,groupvar = faketrial$Treatment)

wrappedtools documentation built on Sept. 24, 2023, 5:06 p.m.