percentile_table: Function locates values corresponding to percentiles in a...

View source: R/percentile_table.R

percentile_tableR Documentation

Function locates values corresponding to percentiles in a vector of numeric data

Description

Function displays a table with lower/upper locations, values, average and spread between lower/upper from median to one hundred and twenty-eighth percentiles. The function returns a list with a viewable gt table along with the data.table containing the table's values.

Usage

percentile_table(vals, na_rm = TRUE, title = NULL, table_width = NULL)

Arguments

vals

A vector of numeric values

na_rm

A logical which if TRUE removes NA values before the calculations

title

A string that sets the table's title. The string can contain R markdown/html style syntax.

table_width

A numeric that sets the overall table width in pixels.

Details

The "label" column of the table correspond to the following percentiles:

  1. "M" = Half (i.e. the median)

  2. "F" = Fourth (i.e. quartiles 25/75)

  3. "E" = Eighth

  4. "D" = Sixteenth

  5. "C" = Thirty-secondth

  6. "B" = Sixty-fourth

  7. "A" = One hundred and twenty-eighth

Value

A named list with a gt object and a data.table with percentile values contained in the display table.

Author(s)

Rick Dean


deandevl/RplotterPkg documentation built on Feb. 1, 2024, 8:02 p.m.