data_describe: Data function: Describe data using tableby() from arsenal...

Description Usage Arguments Value Examples

View source: R/data_describe.R

Description

This function creates a tableby object using more intuitive default parameters. The tableby object should be passed to summary() to create a descriptive table.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data_describe(
  .data,
  by = NULL,
  p_value = FALSE,
  total = FALSE,
  digits = 1L,
  digits.pct = 1L,
  digits.pvalue = 4L,
  ...
)

Arguments

.data

A dataframe

by

Grouping variable by which data are described. If NULL (default), overall total will be shown.

p_value

A logical. Toggle to show p value (default is FALSE).

total

A logical. Toggle to show overall total (default is FALSE) when grouping variable is defined.

digits

An integer. Control the number of decimal place for continuous values (default is 1).

digits.pct

An integer. Control the number of decimal place for percents (default is 1).

digits.pvalue

An integer. Control the number of decimal place for p-values (default is 1).

...

Arguments passed to tableby(). ?tableby for more details.

Value

A tableby object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
library(arsenal)
library(dplyr)

data(mockstudy)

mockstudy %>%
  select(arm, sex, age) %>%
  data_describe(by = arm) %>%
  summary(text = TRUE)

mockstudy %>%
  select(arm, sex, age) %>%
  data_describe() %>%
  summary()

## End(Not run)

zawmtun/slingr documentation built on Dec. 23, 2021, 9:14 p.m.