prepare_data: Wrapper for several data processing functions.

Description Usage Arguments

View source: R/process_data.R

Description

Clean up the input data by dropping observations with missing outcomes OUTCOME, convert desired columns into numerics (vars_to_numeric), convert all logical columns into binary integers convert all character columns into factors convert all factors into integers, by defining additional dummy variables for every factor with > 2 levels.

Usage

1
2
prepare_data(data, OUTCOME, vars_to_numeric, vars_to_int, skip_vars,
  drop_vars = FALSE, verbose = FALSE)

Arguments

data

Input dataset, can be a data.frame or a data.table.

OUTCOME

Character name of the column of outcomes.

vars_to_numeric

Column name(s) that should be converted to numeric type.

vars_to_int

Column name(s) that should be converted to integer type.

skip_vars

These columns will not be converted into other types

drop_vars

Drop the variables in skip_vars and drop the factor variables that were re-coded into binary dummies from the resulting analytic dataset?

verbose

Print processing info


osofr/gridisl documentation built on May 24, 2019, 4:55 p.m.