Re: [R] A basic question about reshape2

2011-03-13 Thread John Kane
I am not sure about this but I don't see how a melt command helps. See what z = dcast(x, I ~ V, mean) gives you. --- On Sun, 3/13/11, Jim & Carolyn Watkins wrote: > From: Jim & Carolyn Watkins > Subject: [R] A basic question about reshape2 > To: r-help@r-project.

[R] A basic question about reshape2

2011-03-13 Thread Jim & Carolyn Watkins
Dear R Community: This is a newbie reshare2 question; it starts with read a set of data and to melt it: x = data.frame(I=c("a","b","a","b","b"), V=c(2,4,2,5,7)) y = melt(x, id = 1:1) What is wrong with the final dcast step: z = dcast(y, formula = I ~ "variable", c(length, mean, median