ds_freq_table: Frequency table

Description Usage Arguments See Also Examples

View source: R/ds-freq-table.R

Description

Frequency table for categorical and continuous data and returns the frequency, cumulative frequency, frequency percent and cumulative frequency percent. plot.ds_freq_table() creates bar plot for the categorical data and histogram for continuous data.

Usage

1
2
3
4
ds_freq_table(data, col, bins = 5)

## S3 method for class 'ds_freq_table'
plot(x, print_plot = TRUE, ...)

Arguments

data

A data.frame or a tibble.

col

Column in data.

bins

Number of intervals into which the data must be split.

x

An object of class ds_freq_table.

print_plot

logical; if TRUE, prints the plot else returns a plot object.

...

Further arguments to be passed to or from methods.

See Also

ds_cross_table

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# categorical data
ds_freq_table(mtcarz, cyl)

# barplot
k <- ds_freq_table(mtcarz, cyl)
plot(k)

# continuous data
ds_freq_table(mtcarz, mpg)

# barplot
k <- ds_freq_table(mtcarz, mpg)
plot(k)

rsquaredacademy/descriptr documentation built on July 9, 2021, 8:13 p.m.