If a user doesn't specify a contrast matrix, use the defaults from options(). If the user tries to use something we don't know how to work with, throw a warning that we'll be using the defaults from options().
factor_col: A factor vector, eg from df$factorVarName
code_by: Some object that's not a matrix or function. If NA, no warning will be thrown, and the default contrasts will be used. A warning will be thrown if it's not NA.
reference_level: Not used
set_intercept: Not used
drop_trends: Not used
labels: A vector of labels to apply to the matrix column names, default
as_is: Logical, default FALSE, whether to leave the resulting matrix
...: Additional arguments, not used
Returns
Contrast matrix, using the ordered or unordered default from options()
Examples
use_contrasts(gl(5,1), helmert_code)# a functionmy_matrix <- helmert_code(5)use_contrasts(gl(5,1), my_matrix)# a matrix