The R Project SVN R

Rev

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

Rev 61433 Rev 61521
Line 1... Line 1...
1
% File src/library/stats/man/reshape.Rd
1
% File src/library/stats/man/reshape.Rd
2
% Part of the R package, http://www.R-project.org
2
% Part of the R package, http://www.R-project.org
3
% Copyright 1995-2011 R Core Team
3
% Copyright 1995-2012 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{reshape}
6
\name{reshape}
7
\alias{reshape}
7
\alias{reshape}
8
\title{Reshape Grouped Data}
8
\title{Reshape Grouped Data}
Line 47... Line 47...
47
  \item{times}{the values to use for a newly created \code{timevar}
47
  \item{times}{the values to use for a newly created \code{timevar}
48
    variable in long format.  See \sQuote{Details}.}
48
    variable in long format.  See \sQuote{Details}.}
49
  \item{drop}{a vector of names of variables to drop before reshaping.}
49
  \item{drop}{a vector of names of variables to drop before reshaping.}
50
  \item{direction}{character string, either \code{"wide"} to reshape to
50
  \item{direction}{character string, either \code{"wide"} to reshape to
51
    wide format, or \code{"long"} to reshape to long format.}
51
    wide format, or \code{"long"} to reshape to long format.}
52
  \item{new.row.names}{logical; if \code{TRUE} and \code{direction = "wide"},
52
  \item{new.row.names}{character or \code{NULL}: a non-null value will be
53
    create new row names in long format from the values of the \code{id} and
-
 
54
    \code{time} variables.}
53
    used for the row names of the result.}
55
  \item{sep}{A character vector of length 1, indicating a separating
54
  \item{sep}{A character vector of length 1, indicating a separating
56
    character in the variable names in the wide format.  This is used for
55
    character in the variable names in the wide format.  This is used for
57
    guessing \code{v.names} and \code{times} arguments based on the
56
    guessing \code{v.names} and \code{times} arguments based on the
58
    names in \code{varying}.  If \code{sep == ""}, the split is just before
57
    names in \code{varying}.  If \code{sep == ""}, the split is just before
59
    the first numeral that follows an alphabetic character.  This is
58
    the first numeral that follows an alphabetic character.  This is
Line 101... Line 100...
101
  Also, guessing is not attempted if \code{v.names} is given
100
  Also, guessing is not attempted if \code{v.names} is given
102
  explicitly.  Notice that the order of variables in \code{varying} is
101
  explicitly.  Notice that the order of variables in \code{varying} is
103
  like \code{x.1},\code{y.1},\code{x.2},\code{y.2}.
102
  like \code{x.1},\code{y.1},\code{x.2},\code{y.2}.
104
 
103
 
105
  The \code{split} argument should not usually be necessary.  The
104
  The \code{split} argument should not usually be necessary.  The
106
  \code{split$regexp} component is passed to either \code{strsplit()} or
105
  \code{split$regexp} component is passed to either
107
  \code{regexp()}, where the latter is used if \code{split$include} is
106
  \code{\link{strsplit}} or \code{\link{regexpr}}, where the latter is
-
 
107
  used if \code{split$include} is \code{TRUE}, in which case the
108
  \code{TRUE}, in which case the splitting occurs after the first
108
  splitting occurs after the first character of the matched string.  In
109
  character of the matched string.  In the \code{strsplit()} case, the
109
  the \code{\link{strsplit}} case, the separator is not included in the
110
  separator is not included in the result, and it is possible to specify
110
  result, and it is possible to specify fixed-string matching using
111
  fixed-string matching using \code{split$fixed}.
111
  \code{split$fixed}.
112
}
112
}
113
\value{
113
\value{
114
  The reshaped data frame with added attributes to simplify reshaping
114
  The reshaped data frame with added attributes to simplify reshaping
115
  back to the original form.
115
  back to the original form.
116
}
116
}