getTable1: GetTable1

Description Usage Arguments Value

View source: R/tablefunctions.R

Description

A function that outputs a table of basic descriptive statistics for specified variables. A numeric variable will return a mean +/- 1 SD. A character/factor variable will return counts. The goal is to make it easy to create a descriptive table from a freshly imported dataset with potentially misleading variable types. The function will automatically coerce variables to a certain variable type, numeric/character/factor, given your tolerance.

Usage

1
getTable1(data, vars, tolerance = 20)

Arguments

data

The dataset you want to describe

vars

A character or character vector. This should be the names of the variables that you want to describe.

tolerance

A numeric value. This is used to help the function determine which variables are truly numeric or character variables. Your tolerance is the number of different values that your categorical variables have. For example, if you have a gender variable of 1 = Male and 2 = Female, then you have 2 different values. Your tolerance should be based on the categorical variable with the most different values.

Value

Returns a dataframe of the descriptive statistics.


erluong/summarytables documentation built on Jan. 21, 2020, 12:10 a.m.