tblinfo: Create an automated data dictionary

View source: R/functions.R

tblinfoR Documentation

Create an automated data dictionary

Description

Create an automated data dictionary

Usage

tblinfo(
  dat,
  custom_stats = alist(),
  info_cols = alist(c_empty = frc_missing == 1, c_uninformative = n_nonmissing < 2,
    c_ordinal = uniquevals < 10 & isnum, c_tm = uniquevals == 1 & n_missing > 0, c_tf =
    uniquevals == 2, c_numeric = isnum & !c_ordinal, c_factor = uniquevals < 20 & !isnum,
    c_complex = !(c_ordinal | c_tm | c_tf | c_numeric | c_factor)),
  ...
)

Arguments

dat

An object that inherits from 'data.frame'

custom_stats

An 'alist' of statistics to calculate on each column of 'dat' in addition to the defaults in 'info_cols' (below). Optional.

info_cols

Another 'alist', this one has default values but can be overridden on an all-or-none basis.

...

Eats any extra arguments, to keep them from causing trouble.

Value

A data-frame having one row for each column in 'dat'

Examples


tblinfo(datasets::iris)


bokov/tidbits documentation built on Jan. 26, 2024, 6:25 p.m.