The levels of a factor are re-ordered so that the level specified by
ref is first and the others are moved down. This is useful
contr.treatment contrasts which take the first level as
relevel(x, ref, ...)
an unordered factor.
the reference level, typically a string.
additional arguments for future methods.
reorder(), is a special case of simply calling
factor(x, levels = levels(x)[....]).
A factor of the same length as
warpbreaks$tension <- relevel(warpbreaks$tension, ref = "M") summary(lm(breaks ~ wool + tension, data = warpbreaks))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.