f_table: Prepare 2D frequency table

View source: R/f - Table.R

f_tableR Documentation

Prepare 2D frequency table

Description

Prepares 2D frequency table.

Usage

f_table(
  df.input,
  c.ver,
  c.hor = NULL,
  c.useNA = "ifany",
  c.type = "abs",
  n.round = 1,
  b.warning = TRUE
)

Arguments

df.input

Data frame containing features c.ver (and c.hor)

c.ver

Feature name to pivot vertically.

c.hor

Feature name to pivot horizontally. If provided this will result in a 2D frequency table, and when not provided the result will be a 1D frequency table (default: NULL).

c.useNA

How to deal with NAs. Options are: "ifany", "no" "always" (default: "ifany").

c.type

Type result. Options are: "abs", "rel" (default: "abs").

n.round

Rounding the numbers (default: 1).

b.warning

Should warnings be shown? (default: TRUE).

Details

-

Value

A 2D (or 1D) frequency table.

Author(s)

Pieter Overdevest

Examples

f_table(

      df.input  = mtcars,
      c.ver     = "gear",
      c.hor     = "am",
      c.useNA   = "ifany",
      c.type    = "abs",
      n.round   = 1,
      b.warning = TRUE
)

pieterov/generaltoolbox documentation built on Jan. 25, 2025, 10:32 a.m.