powered by
If a user provides a raw matrix, then use that matrix as the contrast matrix
# S3 method for matrix use_contrasts( factor_col, code_by = NA, reference_level = NA, set_intercept = NA, drop_trends = NA, labels = NULL, as_is = FALSE, ... )
A contrast coding matrix with labels and proper reference level
A factor vector, eg from df$factorVarName
A matrix to be used as the contrast matrix, should have the same dimensions as the contrast matrix already applied to code_by
Not used
A vector of labels to apply to the matrix column names, default
Logical, default FALSE, whether to leave the resulting matrix
Additional arguments, not used
contrast_matrix <- sum_code(4) use_contrasts(gl(4,1), contrast_matrix)
Run the code above in your browser using DataLab