fdistr (version 0.1.0)

create_table: Create Table

Description

create_table generates a frequency distribution table from a vector, list or data frame input.

Usage

create_table(source, dec_pos = 2)

Arguments

source

Vector, list or data frame input. If the source is of class list, it will be simplified to a vector using unlist.

dec_pos

Number of positions to return in the frequency and cumulative frequency variables. Defaults to two positions following the decimal.

Value

A data frame containing the frequency distribution table. If an error or warning occurs, a message will be printed to the console and the function will return NULL.

Details

create_table returns a data frame that includes five variables: group, count, frequency, cumulative count and cumulative frequency.

Examples

Run this code
# NOT RUN {
source <- c(1, 1, 1, 1, 2, 2, 2, 3, 3, 4)
table <- create_table(source, dec_pos = 3)

# }

Run the code above in your browser using DataLab