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

Description Usage Arguments Details Value

View source: R/desc_cat.R

Description

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

Usage

1
audit_vector_categorical(x, max_length = 15, nchar = 20, plot = TRUE)

Arguments

x

a character vector

max_length

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

nchar

the maximum number of characters to display for each value in the plot

plot

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

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 max_length 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/auditdata documentation built on March 6, 2020, 7:09 p.m.