Skip to content
Prev 105870 / 398513 Next

question about data manipulation

On 12/10/06, Jenny persson <jenny197806 at yahoo.se> wrote:
You might want to have a look at the reshape package,
http://had.co.nz/reshape, which aims to make these operations simple.

For your example, something like the following should work:

dm <- melt(dat, id=c("Slide", "Block","Name"))
cast(dm, Name ~ Slide + Block)
cast(dm, Name ~ Block + Slide)

or even
cast(dm, Name ~ Block ~ Slide)
depending on what you want to do with the data next.

Regards,

Hadley