I am using reshape2 and the great melt() to reshape a matrix.
I would like to use the option value.name to give the value column of
the melted result a personalized name, but that does not work.
Here is a reproducible example:
require(reshape2)
b <- matrix(0, nrow=5, ncol=20)
colnames(b) <- 1:20
rownames(b) <- LETTERS[1:5]
names(melt(b, varnames=c('foo', 'bar'), value.name='baz'))
And this is my sessionInfo():
R version 2.12.1 Patched (2011-01-10 r53950)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
[5] LC_MONETARY=C LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] grid stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] reshape2_1.1 doSNOW_1.0.3 snow_0.3-3 foreach_1.3.0
[5] codetools_0.2-7 iterators_1.0.3 ggplot2_0.8.9 proto_0.3-8
[9] reshape_0.8.3 plyr_1.4 pls_2.1-0 stringr_0.4
[13] rgdal_0.6-33 sp_0.9-76
loaded via a namespace (and not attached):
[1] digest_0.4.2 lattice_0.19-17 tcltk_2.12.1 tools_2.12.1
Cheers,
Pierre
--
Scientist
Landcare Research, New Zealand
--
You received this message because you are subscribed to the Google Groups "manipulatr" group.
To post to this group, send email to manip...@googlegroups.com.
To unsubscribe from this group, send email to manipulatr+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/manipulatr?hl=en.
Pierre
2011/1/14 Dennis Murphy <djm...@gmail.com>:
Hadley
On Thu, Jan 13, 2011 at 10:25 PM, Pierre Roudier
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/