freqsum: Frequency summary, a MJP team defined function

Description Usage Arguments Value Examples

View source: R/freqsum.r

Description

Frequency summary, a MJP team defined function

Usage

1
2
freqsum(InputCol, x = 20, sort_by = "COUNT", sort_descending = T,
  big_mark = NA, round_percent = 4)

Arguments

InputCol

Input column or vector, will be convert into factor.

x

number of categories shown in the summary table, default = 20.

sort_by

sort summary table by "VARIABLE" = category lable or "COUNT" = freqency

sort_descending

show the result in acsending or descending order, default = TRUE, in descending order.

big_mark

adding seperator in the big numbers. if you dont like the scientific notation when using this on large numbers, please change your globle enviromental variable with 'option(scipen = 999)' .

round_percent

the accuracy of the percentage in the summary table of fator variable, 4 digits by default.

Value

A frequency summary table with percentage.

Examples

1
2
    freqsum(my_df$col1)
    freqsum(my_df$col2, x = 50, sort_by = "VARIABLE", sort_descending = T)

richielin/mjp documentation built on May 5, 2019, 12:32 p.m.