use_contrasts.default | R Documentation |
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().
## Default S3 method:
use_contrasts(
factor_col,
code_by = NA,
reference_level = NA,
set_intercept = NA,
drop_trends = NA,
labels = NULL,
as_is = FALSE,
...
)
factor_col |
A factor vector, eg from |
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 |
Contrast matrix, using the ordered or unordered default from
options()
use_contrasts(gl(5,1), helmert_code) # a function
my_matrix <- helmert_code(5)
use_contrasts(gl(5,1), my_matrix) # a matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.