Learn R Programming

descriptr (version 0.1.0)

freq_table: Frequency Table: Categorical Data

Description

freq_table creates frequency table for factor data and returns the frequency, cumulative frequency, frequency percent and cumulative frequency percent. barplot.freq_table creates bar plot for the frequency table created using freq_table

Usage

freq_table(data)

# S3 method for freq_table barplot(height, ...)

Arguments

data

numeric or factor vector

height

an object of class freq_table

...

further arguments to be passed to or from methods

Value

freq_table returns an object of class "freq_table". An object of class "freq_table" is a list containing the following components

ftable

frequency table

varname

name of the data

See Also

link{freq_cont} link{cross_table}

Examples

Run this code
# frequency table
freq_table(mtcars$cyl)
freq_table(as.factor(mtcars$cyl))

# barplot
k <- freq_table(mtcars$cyl)
barplot(k)

Run the code above in your browser using DataLab