Re: [R] reshape data from long to wide format

2011-09-10 Thread Gabor Grothendieck
On Fri, Sep 9, 2011 at 7:28 AM, maxbre wrote: > This is my reproducible example: > > example<-structure(list(SENSOR = structure(1:6, .Label = c("A", "B", "C", > "D", "E", "F"), class = "factor"), VALUE = c(270, 292.5, 0, 45, > 247.5, 315), DATE = structure(1:6, .Label = c(" 01/01/2010 1", > " 01/0

Re: [R] reshape data from long to wide format

2011-09-10 Thread maxbre
thank you to both you, this is exactly the solution I was looking for max -- View this message in context: http://r.789695.n4.nabble.com/reshape-data-from-long-to-wide-format-tp3801381p3803759.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] reshape data from long to wide format

2011-09-09 Thread Dennis Murphy
Hi: There are two ways to go about this, depending on what you want. # 1: Jean's output format: # I'm using the reshape package here with cast(), # but it should work similarly with dcast() in reshape2: > cast(example, DATE ~ SENSOR, value = 'VALUE') DATE A B C D E F 1

Re: [R] reshape data from long to wide format

2011-09-09 Thread Jean V Adams
maxbre wrote on 09/09/2011 06:28:15 AM: > > This is my reproducible example: > > example<-structure(list(SENSOR = structure(1:6, .Label = c("A", "B", "C", > "D", "E", "F"), class = "factor"), VALUE = c(270, 292.5, 0, 45, > 247.5, 315), DATE = structure(1:6, .Label = c(" 01/01/2010 1", > " 01/

[R] reshape data from long to wide format

2011-09-09 Thread maxbre
This is my reproducible example: example<-structure(list(SENSOR = structure(1:6, .Label = c("A", "B", "C", "D", "E", "F"), class = "factor"), VALUE = c(270, 292.5, 0, 45, 247.5, 315), DATE = structure(1:6, .Label = c(" 01/01/2010 1", " 01/01/2010 2", " 01/01/2010 3", " 01/01/2010 4", " 01/01/20