Description Usage Arguments Value
View source: R/tablefunctions.R
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.
1 |
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. |
Returns a dataframe of the descriptive statistics.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.