Re: [R] transform key value pair to column

2009-02-19 Thread Wacek Kusnierczyk
see ?stack, for example. vQ Tan, Richard wrote: Hi, is there a good way (instead of a time-consuming for loop) to transfer a key/value pair dataframe to a dataframe with key as column and value as row? For example, I have a dataframe with three columns: id, code, value: id,code,value

Re: [R] transform key value pair to column

2009-02-19 Thread Rowe, Brian Lee Yung (Portfolio Analytics)
5.8 Brian -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Wacek Kusnierczyk Sent: Thursday, February 19, 2009 5:39 PM To: Tan, Richard Cc: r-help@r-project.org Subject: Re: [R] transform key value pair to column see ?stack

Re: [R] transform key value pair to column

2009-02-19 Thread Tan, Richard
Thank you, works! -Original Message- From: Rowe, Brian Lee Yung (Portfolio Analytics) [mailto:b_r...@ml.com] Sent: Thursday, February 19, 2009 5:52 PM To: Wacek Kusnierczyk; Tan, Richard Cc: r-help@r-project.org Subject: RE: [R] transform key value pair to column Try this: dummy id