View source: R/get_model_data.R
get_model_data | R Documentation |
get_model_data()
ensures that only variables necessary for the model
are included in the dataset and missing data and test sets are removed, if
test_col
is not NULL
. If filter_na
is "all"
(the default), then any
observations with NA
values are removed using na.omit()
. If filter_na
is
"response"
or "predictors"
then only rows with missing dependent or independent
variables are removed, respectively. If "none"
, then no filtering is done at all.
get_model_data(
df,
formula_vars,
test_col,
group_col = NULL,
filter_na,
reduce_columns = TRUE
)
df |
Data frame of model data. |
formula_vars |
Character vector of variables used in the model. Can be
extracted from a formula using |
test_col |
Name of logical column specifying which response values to remove
for testing the model's predictive accuracy. If |
group_col |
Column name(s) of group(s) to use in |
filter_na |
Character value specifying how, if at all, to filter |
reduce_columns |
Logical on whether or not to reduce the number of columns in the data to just those necessary for modelling. |
A data frame.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.