summary_category {fabR}R Documentation

Create summary tibble of one (possibly grouped) category-type column

Description

This function creates datatable of the values of a column separating valid, non-valid and missing values. Missing values can be given as input to non-valid and valid values separately, or grouped by another column. The output can be editable (using plotly library) or static (using ggplot2 library). The R-code is also editable for coding recycling purpose. The user can download the datatable in csv format.

Usage

summary_category(
  tbl = "iris",
  col = "col",
  filter = "c()",
  negate = FALSE,
  missing_values = "c()",
  out = "DT-cat",
  group_by = NULL
)

Arguments

tbl

A character string or tibble specifying the input tibble

col

A character string of a column of interest

filter

A character string to subset the rows, applying the expressions to the column values to determine which rows should be retained. It can be applied to both grouped and ungrouped data.

negate

If TRUE, return non-matching elements.

missing_values

Vector listing values to exclude from valid values. Those values will not be excluded from counting, but will be separated from valid values.

out

parameter that specifies the output expected: can be either 'DT', 'DT-code' and 'DT-cat'. DT renders a datatable using DT library, code gives the code in a string (usable directly with eval/parse functions) and cat provides indented code in the console.

group_by

A character string of one column in the tbl that can be taken as a grouping column. The visual element will be grouped and displayed by this column.

Value

A datatable (editable) object or a R script in a character string to create it.

See Also

DT::datatable()

Examples

{

##### Example 1 -------------------------------------------------------------
# cat output generated as a template when no argument provided
summary_category()

##### Example 2 -------------------------------------------------------------
# summary table of Petal.Length
summary_category(tbl = iris, col = "Species", out = "DT")

}


[Package fabR version 1.1.1 Index]