The R Project SVN R

Rev

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

Rev 68948 Rev 70857
Line 1... Line 1...
1
% File src/library/utils/man/stack.Rd
1
% File src/library/utils/man/stack.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-2011 R Core Team
3
% Copyright 1995-2016 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{stack}
6
\name{stack}
7
\alias{stack}
7
\alias{stack}
8
\alias{stack.default}
8
\alias{stack.default}
Line 16... Line 16...
16
  along with a factor indicating where each observation originated.
16
  along with a factor indicating where each observation originated.
17
  Unstacking reverses this operation.
17
  Unstacking reverses this operation.
18
}
18
}
19
\usage{
19
\usage{
20
stack(x, \dots)
20
stack(x, \dots)
21
\method{stack}{default}(x, \dots)
21
\method{stack}{default}(x, drop=FALSE, \dots)
22
\method{stack}{data.frame}(x, select, \dots)
22
\method{stack}{data.frame}(x, select, drop=FALSE, \dots)
23
 
23
 
24
unstack(x, \dots)
24
unstack(x, \dots)
25
\method{unstack}{default}(x, form, \dots)
25
\method{unstack}{default}(x, form, \dots)
26
\method{unstack}{data.frame}(x, form, \dots)
26
\method{unstack}{data.frame}(x, form, \dots)
27
}
27
}
Line 31... Line 31...
31
    data frame.}
31
    data frame.}
32
  \item{form}{a two-sided formula whose left side evaluates to the
32
  \item{form}{a two-sided formula whose left side evaluates to the
33
    vector to be unstacked and whose right side evaluates to the
33
    vector to be unstacked and whose right side evaluates to the
34
    indicator of the groups to create.  Defaults to \code{\link{formula}(x)}
34
    indicator of the groups to create.  Defaults to \code{\link{formula}(x)}
35
    in the data frame method for \code{unstack}.}
35
    in the data frame method for \code{unstack}.}
-
 
36
  \item{drop}{Whether to drop the unused levels from the \dQuote{ind}
-
 
37
    column of the return value.
-
 
38
  }
36
  \item{\dots}{further arguments passed to or from other methods.}
39
  \item{\dots}{further arguments passed to or from other methods.}
37
}
40
}
38
\details{
41
\details{
39
  The \code{stack} function is used to transform data available as
42
  The \code{stack} function is used to transform data available as
40
  separate columns in a data frame or list into a single column that can
43
  separate columns in a data frame or list into a single column that can