The R Project SVN R

Rev

Rev 68948 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68948 Rev 70666
Line 1... Line 1...
1
% File src/library/stats/man/relevel.Rd
1
% File src/library/stats/man/relevel.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2007 R Core Team
3
% Copyright 1995-2007, 2016 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{relevel}
6
\name{relevel}
7
\alias{relevel}
7
\alias{relevel}
8
\alias{relevel.default}
8
\alias{relevel.default}
Line 11... Line 11...
11
\title{Reorder Levels of Factor}
11
\title{Reorder Levels of Factor}
12
\usage{
12
\usage{
13
relevel(x, ref, \dots)
13
relevel(x, ref, \dots)
14
}
14
}
15
\arguments{
15
\arguments{
16
    \item{x}{An unordered factor.}
16
  \item{x}{an unordered factor.}
17
    \item{ref}{The reference level.}
17
  \item{ref}{the reference level, typically a string.}
18
    \item{\dots}{Additional arguments for future methods.}
18
  \item{\dots}{additional arguments for future methods.}
19
}
19
}
20
\description{
20
\description{
21
    The levels of a factor are re-ordered so that the level specified by
21
    The levels of a factor are re-ordered so that the level specified by
22
    \code{ref} is first and the others are moved down. This is useful
22
    \code{ref} is first and the others are moved down. This is useful
23
    for \code{contr.treatment} contrasts which take the first level as
23
    for \code{contr.treatment} contrasts which take the first level as
24
    the reference.
24
    the reference.
25
}
25
}
26
\value{
26
\value{
27
  A factor of the same length as \code{x}.
27
  A factor of the same length as \code{x}.
28
}
28
}
-
 
29
\details{
-
 
30
  This, as \code{\link{reorder}()}, is a special case of simply calling
-
 
31
  \code{\link{factor}(x, levels = levels(x)[....])}.
29
 
32
}
30
\seealso{
33
\seealso{
31
  \code{\link{factor}}, \code{\link{contr.treatment}},
34
  \code{\link{factor}}, \code{\link{contr.treatment}},
32
  \code{\link{levels}}, \code{\link{reorder}}.
35
  \code{\link{levels}}, \code{\link{reorder}}.
33
}
36
}
34
 
37