Skip to content
Prev 278723 / 398502 Next

how to transform a data file

library(reshape2)
# sample data because you didn't provide any
dta <- as.data.frame( matrix( sample( 0:1, 100, replace=TRUE ), ncol=10 ) )
dta <- cbind( IDN=1:10, dta )
# The command you couldn't figure out
meltdta <- melt( dta, "IDN" )
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
pat j <pjsleuth at gmail.com> wrote: