Description Usage Arguments Value Examples
the range of one specified variable is expanded, while all other variables are set to the most common values. Similar to modelr::data_grid but it can deal with factors.
1 2 | f_model_data_grid(col_var, data_ls, formula, n = 500,
set_manual = list())
|
col_var |
character vector, denoting variable that should be expanded |
data_ls |
data_ls object generated by f_clean_data(), or a named list list( data = <dataframe>, numericals = < vector with column names of numerical columns>) |
formula |
formula |
n |
integer, length of grid, datapoints in between range of col_var |
set_manual |
named list, set some variables manually instead of defaulting to median or most common factor. !! Values need to be of the same variable type as in the original data. |
dataframe
1 2 3 4 | data_ls = f_clean_data(mtcars)
formula = disp~cyl+mpg+hp
f_model_data_grid( 'mpg', data_ls, formula, 10 )
f_model_data_grid( 'mpg', data_ls, formula, 10 , set_manual = list( cyl = min(data_ls$data$cyl) ) )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.