The R Project SVN R

Rev

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

Rev 27442 Rev 28250
Line 57... Line 57...
57
  collapse the contingency table into flat form.  If neither of these
57
  collapse the contingency table into flat form.  If neither of these
58
  two is given, the last variable is used for the columns.  If both are
58
  two is given, the last variable is used for the columns.  If both are
59
  given and their union is a proper subset of all variables involved,
59
  given and their union is a proper subset of all variables involved,
60
  the other variables are summed out.
60
  the other variables are summed out.
61
 
61
 
-
 
62
  When the arguments are \R expressions interpreted as factors,
-
 
63
  additional arguments will be passed to \code{table} to control how
-
 
64
  the variable names are displayed; see the last example below.
-
 
65
 
62
  Function \code{\link{ftable.formula}} provides a formula method for
66
  Function \code{\link{ftable.formula}} provides a formula method for
63
  creating flat contingency tables.
67
  creating flat contingency tables.
64
}
68
}
65
\seealso{
69
\seealso{
66
  \code{\link{ftable.formula}} for the formula interface (which allows a
70
  \code{\link{ftable.formula}} for the formula interface (which allows a
Line 80... Line 84...
80
## Start with a data frame.
84
## Start with a data frame.
81
data(mtcars)
85
data(mtcars)
82
x <- ftable(mtcars[c("cyl", "vs", "am", "gear")])
86
x <- ftable(mtcars[c("cyl", "vs", "am", "gear")])
83
x
87
x
84
ftable(x, row.vars = c(2, 4))
88
ftable(x, row.vars = c(2, 4))
-
 
89
 
-
 
90
## Start with expressions, use table()'s "dnn" to change labels
-
 
91
ftable(mtcars$cyl, mtcars$vs, mtcars$am, mtcars$gear, row.vars = c(2, 4), 
-
 
92
       dnn = c("Cylinders", "V/S", "Transmission", "Gears"))
85
}
93
 }
86
\keyword{category}
94
\keyword{category}