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.
# S3 method for 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; a
positive whole number.
closed
Interval closure for continuous data. "left" (the
default) gives half-open intervals with the last interval closed;
"right" gives right-closed intervals with the first interval closed;
"both" reproduces the legacy behaviour in which boundary values are
counted in both adjacent intervals.
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.
Details
Percentages are computed over all observations, including missing
values, so the Percent column and the Missing row share the
same denominator and add up to 100. Continuous data with no non-missing
observations, or with no variation, cannot be binned and raise an error.