base_tab_prep: Prepare a data frame for base tabulating

View source: R/base_tab_prep.r

base_tab_prepR Documentation

Prepare a data frame for base tabulating

Description

Remove difficult variables: dates, factors with too many unique values, etc.

Usage

base_tab_prep(
  X,
  max.unique = 10,
  elim.names = NULL,
  force.factor = TRUE,
  binary.code = TRUE,
  elim.class = NULL
)

Arguments

X

a data frame

max.unique

maximum number of unique values to tolerate (for non-numeric variables), default 10

elim.names

set of names to eliminate

force.factor

TRUE (default) if caracter vectors should be factors

binary.code

convert a 0/1 variable into a factor with these labels (if TRUE then 0 = "No" and 1 = "Yes").

elim.class

a set of classes to eliminate in addition to Date, POSIXct and POSIXt

Author(s)

Henrik Renlund


renlund/ucR documentation built on March 25, 2023, 10:10 a.m.