Learn R Programming

crtests (version 0.2.1)

prepare_data: Prepare data for training or testing.

Description

This function removes all missing values, including those introduced after (optional) releveling

Usage

prepare_data(df, df_reference, dependent, relevel = TRUE, drop.nas = c("dependent", "predictors", "all", "none"))

Arguments

df
The data frame that is to be prepared
df_reference
An optional reference data frame, whose factor levels are to be applied to df
dependent
The dependent variable of the data
relevel
Logical. Should the df be releveled with df_reference's factor levels?
drop.nas
Character vector denoting of which columns the NAs should be removed. See drop_na for the available strategies

Value

A data frame stripped of missing values