[R] Syntax Check: rshape2 melt()

Rich Shepard rshepard at appl-ecosys.com
Thu Oct 27 20:16:33 CEST 2011


On Thu, 27 Oct 2011, Nordlund, Dan (DSHS/RDA) wrote:

> You should be able to get what you want using the dcast function (I think).
>
> test.melted <- melt(tds.anal)
> dcast(test.melted, site + sampdate ~ param)

Dan,

   I don't think the data frame melted properly. I tried the dcast() but
sampdate is not found:

c.tds.anal <- dcast(m.tds.anal, site + sampdate ~ param)
Error in eval(expr, envir, enclos) : object 'sampdate' not found

   Perhaps I still need to better understand the parameters in the melt()
function.

Rich



More information about the R-help mailing list