table1: Table 1

View source: R/table1.R

table1R Documentation

Table 1

Description

Build Table 1. Subject characteristics

Usage

table1(
  x,
  summaryFn1 = mean,
  summaryFn2 = sd,
  summaryFn1.extraArgs = list(na.rm = TRUE),
  summaryFn2.extraArgs = list(na.rm = TRUE),
  labelify = TRUE,
  verbose = TRUE,
  filename = NULL
)

Arguments

x

data.frame or matrix: Input data, cases by features

summaryFn1

Function: Summary function 1. Default = mean. See Details

summaryFn2

Function: Summary function 2. Default = sd. See Details

summaryFn1.extraArgs

List: Extra arguments for summaryFn1.

summaryFn2.extraArgs

List: Extra arguments for summaryFn2.

labelify

Logical: If TRUE, apply labelify to column names of x

verbose

Logical: If TRUE, print messages to console.

filename

Character: Path to output CSV file to save table.

Details

The output will look like "summaryFn1 (summaryFn2)". Using defaults this will be "mean (sd)"

Value

A data.frame, invisibly, with two columns: "Feature", "Value mean (sd) | N"

Author(s)

E.D. Gennatas

Examples

table1(iris)

egenn/rtemis documentation built on Oct. 28, 2024, 6:30 a.m.