[R] Merge data frames but with a twist.

2009-08-27 Thread Tony Breyal
Dear all, Question: How to merge two data frames such that new column are added in a particular way? I'm not actually sure how to best articulate my question to be honest, so i hope showing you what I want to achieve will communicate my question better. Lets say I have two data frames: DF1 -

Re: [R] Merge data frames but with a twist.

2009-08-27 Thread Henrique Dallazuanna
Try this: xtabs(as.numeric(Measure) ~ Show + Datetime, data = DF3) On Thu, Aug 27, 2009 at 8:04 AM, Tony Breyal tony.bre...@googlemail.comwrote: Dear all, Question: How to merge two data frames such that new column are added in a particular way? I'm not actually sure how to best

Re: [R] Merge data frames but with a twist.

2009-08-27 Thread Stephen Tucker
class) - Original Message From: Tony Breyal tony.bre...@googlemail.com To: r-help@r-project.org Sent: Thursday, August 27, 2009 4:04:30 AM Subject: [R] Merge data frames but with a twist. Dear all, Question: How to merge two data frames such that new column are added in a particular way

Re: [R] Merge data frames but with a twist.

2009-08-27 Thread Gabor Grothendieck
On Thu, Aug 27, 2009 at 9:55 AM, Stephen Tuckerbrown_...@yahoo.com wrote: You may want to use the reshape package for this task: library(reshape) recast(DF3,Show ~ Datetime, id.var=names(DF3),value=Measure)       Show 08/26/2009 11:30 AM 08/26/2009 9:30 AM 1   Firefly                   3    

Re: [R] Merge data frames but with a twist.

2009-08-27 Thread Stephen Tucker
To: Stephen Tucker brown_...@yahoo.com Cc: Tony Breyal tony.bre...@googlemail.com; r-help@r-project.org Sent: Thursday, August 27, 2009 7:27:26 AM Subject: Re: [R] Merge data frames but with a twist. On Thu, Aug 27, 2009 at 9:55 AM, Stephen Tuckerbrown_...@yahoo.com wrote: You may want to use the reshape

Re: [R] Merge data frames but with a twist.

2009-08-27 Thread Gabor Grothendieck
7:27:26 AM Subject: Re: [R] Merge data frames but with a twist. On Thu, Aug 27, 2009 at 9:55 AM, Stephen Tuckerbrown_...@yahoo.com wrote: You may want to use the reshape package for this task: library(reshape) recast(DF3,Show ~ Datetime, id.var=names(DF3),value=Measure)       Show 08/26/2009