Learn R Programming

dtables (version 0.2.0)

dtable: Generate descriptive frequencies and statistics tables

Description

Simplifies the process and reduces the amount of code involved in generating descriptive frequencies and statistics tables by taking your entire dataset as input and generating the tables it predicts you would need given various variable aspects such as class.

Usage

dtable(data1, vars = NULL, frequencies = NULL, statistics = NULL, neat = TRUE, as.list = FALSE, sizesort = FALSE)

Arguments

data1
a data.frame or matrix
vars
select which columns of data1 to analyze
frequencies
select which columns to create frequencies tables for
statistics
select which columns to create statistics tables for
neat
logical, if TRUE returns rounded and formatted tables
as.list
logical, if TRUE it returns frequencies and statistics tables in a list format, split by variables
sizesort
logical, if TRUE returns data sorted by frequency and mean

Value

Returns descriptive frequencies and statistics tables for all variables in data1 by default. Predicts whether to create a frequencies table, statistics table, or both for each varible based on information gathered using dvariable.

Examples

Run this code
# Analyze all data
dtable(iris2)

#Analyze two or more variables
dtable(iris2, vars = c("Color", "Sold", "LikelyToBuy"))

# Analyze a single variable
dtable(iris2, vars = "Color")

# Return raw output
dtable(iris2, neat = FALSE)

# Return list output
dtable(iris2, as.list = TRUE)

# Frequencies sorted by size
dtable(iris2, sizesort = TRUE)

Run the code above in your browser using DataLab