| to.wide {MethComp} | R Documentation |
These functions are merely wrappers for reshape.
Given the complicated syntax of reshape and the particularly simple
structure of this problem, the functions facilitate the conversion
enormously.
to.wide( data ) to.long( data, vars )
data |
A dataframe |
vars |
The variables representing measurements by different methods. Either a character vector of names, or a numerical vector with the number of the variables in the dataframe. |
If data represents method comparisons with exchangeable
replicates within method, the transformation to wide format does not
necessarily make sense.
A dataframe.
Bendix Carstensen, Steno Diabetes Center, http://www.biostat.ku.dk/~bxc
data( milk ) str( milk ) mw <- to.wide( milk ) str( mw ) ( mw <- subset( mw, item < 3 ) ) to.long( mw, 3:4 )