desc_cat: This function summarises a character vector. It returns table...

Description Usage Arguments Details Value

Description

This function summarises a character vector. It returns table with descriptive statistics and plots the frequency table.

Usage

1
desc_cat(x, length_out = 15, nchar = 20, min_unique = 15, plot = TRUE)

Arguments

x

a character vector

nchar

the maximum number of characters to display for each value in the plot param min_unique the minimal number of unique values for a numeric vector to be describe as a numeric vector and not as a categorical vector. Defaults to 15.

plot

logical, whether to plot the graph. Defaults to TRUE.

lenght_out

the maximum number of different values to display in the freqeuncy table and the frequency plot

Details

Missing values are removed at the beginning and statistics are computed on the vector without missing data.

Value

a list with two tables, one with summary statistics (lenght, number of na, number of unique and number of duplicate) and a frequency table for the top most frequent length_out values. If plot is FALSE then the graph of the frequency table is also returned in the list. If x has 2 unique values then a stack bar chart is created, if it has only one then only the tables are returned.


MathieuMarauri/explorer documentation built on Jan. 8, 2020, 6:37 p.m.