Re: [R] reshape help

2013-02-04 Thread arun
   0     0         1            0              1      1   #pneumonia #1         0 #2         1 #3         0 A.K. - Original Message - From: Robert Strother To: r-help@r-project.org Cc: Sent: Monday, February 4, 2013 3:16 AM Subject: [R] reshape help Dear R users - I have a list of patie

Re: [R] reshape help

2013-02-04 Thread Eik Vettorazzi
Hi Robert, how about this? tmp<-read.table(text="ID Dx Anausea Adiabetes Akidney_failure Aheart_attack Afever Bfever Bpneumonia Bheart_attack Bnausea Bcough Ckidney_failure Cnausea Cfoot_pain",header=T) data.frame(cbind(ID=levels(tmp$ID),(tabl

Re: [R] reshape help

2007-09-12 Thread Peter Dalgaard
Ross Darnell wrote: > > > Yup. 2.6.0 will also allow this simplified variant: > > > reshape(mydat, direction="long", varying=3:8, sep="") > tree serra time bt mm id > 1.1 1 11 101 9101 1 > 2.1 2 11 102 9102 2 > 3.1 3 11 103 9103 3 > [Ross D]

Re: [R] reshape help

2007-09-12 Thread François Pinard
[Ross Darnell] >>> I'm trying to use reshape but I cannot quite understand how it >>> works. >Yup. 2.6.0 will also allow this simplified variant: > > reshape(mydat, direction="long", varying=3:8, sep="") > > [...] Hi, people. Have "melt" and "cast" (from the "reshape" package) ever been cons

Re: [R] reshape help

2007-09-12 Thread Ross Darnell
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Dalgaard Sent: Thursday, 13 September 2007 7:02 AM To: Chuck Cleland Cc: R-help; juli pausas Subject: Re: [R] reshape help Chuck Cleland wrote: > juli pausas wrote: > >> Hi, >>

Re: [R] reshape help

2007-09-12 Thread Peter Dalgaard
Chuck Cleland wrote: > juli pausas wrote: > >> Hi, >> I'm trying to use reshape but I cannot quite understand how it works. >> Could somebody help me on this? Example, my data is something like: >> >> mydat <- data.frame(tree= 1:10, serra=rep(1:2, c(5,5)), bt01= 101:110, >> bt02= 201:210, bt03=

Re: [R] reshape help

2007-09-12 Thread Chuck Cleland
juli pausas wrote: > Hi, > I'm trying to use reshape but I cannot quite understand how it works. > Could somebody help me on this? Example, my data is something like: > > mydat <- data.frame(tree= 1:10, serra=rep(1:2, c(5,5)), bt01= 101:110, > bt02= 201:210, bt03= 301:310, mm01= 9101:9110, mm02=

[R] reshape help

2007-09-12 Thread juli pausas
Hi, I'm trying to use reshape but I cannot quite understand how it works. Could somebody help me on this? Example, my data is something like: mydat <- data.frame(tree= 1:10, serra=rep(1:2, c(5,5)), bt01= 101:110, bt02= 201:210, bt03= 301:310, mm01= 9101:9110, mm02= 9201:9210, mm03= 9301:9310) >