Rev 11703 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{reshapeLong}\alias{reshapeLong}\title{Reshape data frame to long format}\description{(EXPERIMENTAL). Convert data frame with repeated measurements inwide format with repeatedobservations in multiple variables across rows to longformat, 1 row per observation.}\usage{reshapeLong(x, jvars, ilev=row.names(x), jlev=names(x)[jvars],iname="reshape.i", jname="reshape.j", vname="reshape.v")}%- maybe also `usage' for other objects documented here.\arguments{\item{x}{The data frame to convert}\item{jvars}{The variables to reshape by}\item{ilev}{Levels of 1st indexing factor}\item{jlev}{Levels of 2nd indexing factor}\item{iname}{Name of 1st indexing factor}\item{jname}{Name of 2nd indexing factor }\item{vname}{Name of variable holding the combined values of the"across" variables}}\details{This causes the values in \code{jvars} to be combined into a singlevariable, all other variables being replicated the relevant number oftimes. Two factors are added to the data frame indicating rows andcolumns of the original data format.}\value{The reshaped data frame.}\note{The same substitution tricks are used for \code{jvars} as for the\code{select} argument to \code{subset}. I.e.\ the argument is treatedas an expression and variables are replaced with their number in thedata frame, allowing ranges of variables to be specified.}\section{Bugs}{There ought to be a way to have multiple sets of\code{jvars} variables.}\seealso{\code{\link{reshapeWide}}, \code{\link{stack}} }\examples{(dd<-as.data.frame(matrix(1:24,4)))reshapeLong(dd,V3:V5)}\keyword{ manip }%-- one or more ...