create_table: Create Table

Description Usage Arguments Details Value Examples

View source: R/create_table.R

Description

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

Usage

1
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.

Details

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

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.

Examples

1
2
source <- c(1, 1, 1, 1, 2, 2, 2, 3, 3, 4)
table <- create_table(source, dec_pos = 3)

fdistr documentation built on Jan. 11, 2020, 9:13 a.m.