The R Project SVN R

Rev

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

Rev 61433 Rev 61900
Line 30... Line 30...
30
}
30
}
31
\description{
31
\description{
32
  \code{model.matrix} creates a design (or model) matrix.
32
  \code{model.matrix} creates a design (or model) matrix.
33
}
33
}
34
\details{
34
\details{
35
  \code{model.matrix} creates a design matrix from the description given
35
  \code{model.matrix} creates a design matrix from the description
36
  in \code{terms(object)}, using the data in \code{data} which must
36
  given in \code{terms(object)}, using the data in \code{data} which
37
  supply variables with the same names as would be created by a call to
37
  must supply variables with the same names as would be created by a
38
  \code{model.frame(object)} or, more precisely, by evaluating
38
  call to \code{model.frame(object)} or, more precisely, by evaluating
39
  \code{attr(terms(object), "variables")}.  If \code{data} is a data
39
  \code{attr(terms(object), "variables")}.  If \code{data} is a data
40
  frame, there may be other columns and the order of columns is not
40
  frame, there may be other columns and the order of columns is not
41
  important.  Any character variables are coerced to factors, with a
41
  important.  Any character variables are coerced to factors.  After
42
  warning.  After coercion, all the variables used on the right-hand
42
  coercion, all the variables used on the right-hand side of the
43
  side of the formula must be logical, integer, numeric or factor.
43
  formula must be logical, integer, numeric or factor.
44
 
44
 
45
  If \code{contrasts.arg} is specified for a factor it overrides the
45
  If \code{contrasts.arg} is specified for a factor it overrides the
46
  default factor coding for that variable and any \code{"contrasts"}
46
  default factor coding for that variable and any \code{"contrasts"}
47
  attribute set by \code{\link{C}} or \code{\link{contrasts}}.
47
  attribute set by \code{\link{C}} or \code{\link{contrasts}}.
48
 
48