Re: [R] Conditionally constructing columns in a data frame

2010-06-29 Thread David Winsemius
On Jun 29, 2010, at 2:54 PM, Stuart Luppescu wrote: Hello, I have to construct 5 new columns in a data frame depending on the value of another of the columns in the data frame. The only way I could figure out to do this was to subset the data frame five times, do the variable construction, a

Re: [R] Conditionally constructing columns in a data frame

2010-06-29 Thread Stuart Luppescu
On Tue, 2010-06-29 at 13:59 -0500, Erik Iverson wrote: > I'm sure there's an easier way, but it's going to be easiest to get a > useful response if we have a reproducible, minimal example, as the > posting guide requests. ?tapply is probably involved. A minimal example of data? How about this:

Re: [R] Conditionally constructing columns in a data frame

2010-06-29 Thread Erik Iverson
I'm sure there's an easier way, but it's going to be easiest to get a useful response if we have a reproducible, minimal example, as the posting guide requests. ?tapply is probably involved. Stuart Luppescu wrote: Hello, I have to construct 5 new columns in a data frame depending on the value