Frequency table for factor data and returns the frequency, cumulative frequency, frequency percent and cumulative frequency percent. barplot.ds_freq_table() creates bar plot for the frequency table created using ds_freq_table().

ds_freq_table(data, variable)

# S3 method for ds_freq_table
plot(x, ...)

Arguments

data

A data.frame or a tibble.

variable

Column in data.

x

An object of class ds_freq_table.

...

Further arguments to be passed to or from methods.

Value

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

ftable

Frequency table.

Deprecated function

freq_table() has been deprecated. Instead use ds_freq_table().

See also

Examples

# frequency table ds_freq_table(mtcarz, cyl)
#> Variable: cyl #> ----------------------------------------------------------------------- #> Levels Frequency Cum Frequency Percent Cum Percent #> ----------------------------------------------------------------------- #> 4 11 11 34.38 34.38 #> ----------------------------------------------------------------------- #> 6 7 18 21.88 56.25 #> ----------------------------------------------------------------------- #> 8 14 32 43.75 100 #> ----------------------------------------------------------------------- #> Total 32 - 100.00 - #> ----------------------------------------------------------------------- #>
# barplot k <- ds_freq_table(mtcarz, cyl) plot(k)