The R Project SVN R

Rev

Rev 15518 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15518 Rev 17330
Line 31... Line 31...
31
}
31
}
32
\details{
32
\details{
33
  The \code{stack} function is used to transform data available as
33
  The \code{stack} function is used to transform data available as
34
  separate columns in a data frame or list into a single column that can
34
  separate columns in a data frame or list into a single column that can
35
  be used in an analysis of variance model or other linear model.  The
35
  be used in an analysis of variance model or other linear model.  The
36
  \code{unstack} function reverses this operation.
36
  \code{unstack} function reverses this operation. 
37
}
37
}
38
\value{
38
\value{
39
  \code{unstack} produces a list of columns according to the formula
39
  \code{unstack} produces a list of columns according to the formula
40
  \code{form}.  If all the columns have the same length, the resulting
40
  \code{form}.  If all the columns have the same length, the resulting
41
  list is coerced to a data frame.
41
  list is coerced to a data frame.
Line 46... Line 46...
46
  \item{ind}{a factor indicating from which vector in \code{x} the
46
  \item{ind}{a factor indicating from which vector in \code{x} the
47
    observation originated}
47
    observation originated}
48
}
48
}
49
\author{Douglas Bates}
49
\author{Douglas Bates}
50
\seealso{
50
\seealso{
51
  \code{\link{lm}}
51
  \code{\link{lm}}, \code{\link{reshape}}
52
}
52
}
53
\examples{
53
\examples{
54
data(PlantGrowth)
54
data(PlantGrowth)
55
formula(PlantGrowth)         # check the default formula
55
formula(PlantGrowth)         # check the default formula
56
pg <- unstack(PlantGrowth)   # unstack according to this formula
56
pg <- unstack(PlantGrowth)   # unstack according to this formula