Reorder Levels of Factor
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.
A factor of the same length as
warpbreaks$tension <- relevel(warpbreaks$tension, ref = "M") summary(lm(breaks ~ wool + tension, data = warpbreaks))
Looks like there are no examples yet.