powered by
Decide which variable to keep
var_to_keep( values, n_kept = NULL, prop_kept = NULL, cutoff = NULL, maximize = TRUE )
A logical vector indicating if variables are kept or discarded.
A numeric vector, with one value per variable to keep or discard.
Number of variables to keep.
A numeric value between 0 and 1 representing the proportion of variables to keep. n_kept and prop_kept are mutually exclusive.
n_kept
prop_kept
Threshold beyond which (below or above) the variables are discarded.
Whether to minimize (FALSE) or maximize (TRUE, the default) the quantity given by values.
FALSE
TRUE
values
Antoine Bichat
scimo:::var_to_keep(1:5, n_kept = 3, maximize = TRUE) scimo:::var_to_keep(1:10, cutoff = 8, maximize = FALSE)
Run the code above in your browser using DataLab