data_dict: Generate a data dictionary.

View source: R/data_dict.R

data_dictR Documentation

Generate a data dictionary.

Description

Used to generate an easily sharable data dictionary for an R dataframe. This supports the following classes: numeric, integer, logical, Date, character, String, factor, ordered.

Usage

data_dict(df, var_include = NULL, var_exclude = NULL, label = FALSE)

Arguments

df

Dataframe.

var_include

Vector of names of variables that are desired to be included in the data dictionary (default: NULL).

var_exclude

Vector of names of variables that are desired to be excluded from the data dictionary (default: NULL).

label

Logical value (default = FALSE). If TRUE, then include the variable label for each variable (if assigned).

Value

Dataframe with 4 columns: variable (variable name), class (variable class), na_pct (the percentage of data which is NA for that variable), and value (an appropriate summary for the variable class).


kamclean/collaborator documentation built on Nov. 17, 2023, 3:52 a.m.