A convenient wrapper function for caret::findLinearCombos
, allowing to detect linear dependencies among the statistics,
and optionally to remove variables that induce them.
check_raw_stats(x, statNames, remove = FALSE, verbose = interactive())
Return type depends on the availability of the caret package, and on the remove
argument, as follows. if remove=TRUE
, an object of the same class as x
is returned (with redundant columns removed). If remove=FALSE
, either the caret package is available, in which case a list is returned with the same structure as the return value of caret::findLinearCombos
but with column indices replaced by column names; or a message pointing that caret is not available is returned (and another is printed, only once per session).
data frame (particularly inheriting from class "reftable"
, i.e. a reference table of simulations); or possibly a matrix with column names
Character vector: variables among which dependencies are sought. Must belong column names of x
. For a reftable
, this argument is optional and by default, all raw statistic are included. For other classes of input, this argument is required.
Boolean: whether to return x
with “offending” columns removed, or other information.
Boolean: whether to display some messages.