View source: R/glimpse_contrasts.R
glimpse_contrasts | R Documentation |
Uses the same syntax as enlist_contrasts()
and
set_contrasts()
. Returns a summary table of the contrasts you've set. If
you set return.list=TRUE
then you can access a list of contrasts in the
second element of the resulting list. The glimpse dataframe is the first
element. FALSE
will return just the glimpse data frame.
glimpse_contrasts(
model_data,
...,
return_list = FALSE,
show_all_factors = TRUE,
add_namespace = FALSE,
show_one_level_factors = FALSE,
minimal = TRUE,
verbose = getOption("contrastable.verbose")
)
model_data |
Data to be passed to a model fitting function |
... |
Series of formulas |
return_list |
Logical, defaults to FALSE, whether the output of enlist_contrasts should be returned |
show_all_factors |
Logical, defaults to TRUE, whether the factors not explicitly set with formulas should be included |
add_namespace |
Logical, defaults to FALSE, whether to append the namespace of the contrast scheme to the scheme name |
show_one_level_factors |
Logical, should factors with only one level be included in the output? Default is FALSE to omit |
minimal |
Logical, default TRUE, whether to omit the orthogonal, centered, dropped_trends, and explicitly_set columns from the output table |
verbose |
Logical, defaults to TRUE, whether messages should be printed |
Generally, glimpse_contrasts
will give warnings about mismatches between
the specified contrasts and what's actually set on the factors in a
dataframe. The warnings will typically tell you how to resolve these
mismatches. See the contrasts
and warnings
vignettes for more
information.
A dataframe if return.list is FALSE, a list with a dataframe and list of named contrasts if TRUE.
enlist_contrasts()
set_contrasts()
my_contrasts <- list(cyl ~ sum_code, carb ~ helmert_code)
my_data <- set_contrasts(mtcars, my_contrasts, verbose = FALSE)
my_data$gear <- factor(my_data$gear) # Make gear a factor manually
# View information about contrasts; gear will use default for unordered
glimpse_contrasts(my_data, my_contrasts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.