Learn R Programming

MethComp (version 1.30.2)

to.wide: Functions to convert between long and wide representations of data

Description

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.

Usage

to.wide(data, warn = TRUE)

Value

A data frame with the reshaped data

Arguments

data

A Meth object.

warn

Logical. Should a warning be printed when replicates are taken as items?

Details

If data represents method comparisons with exchangeable replicates within method, the transformation to wide format does not necessarily make sense.

Examples

Run this code

data( milk )
str( milk )
mw <- to.wide( milk )
str( mw )
( mw <- subset( mw, as.integer(item) < 3 ) )
to.long( mw, 3:4 )

Run the code above in your browser using DataLab