Re: [R] an unsophisticated question about recoding in a data frame with control structure if {}

2008-10-01 Thread Kenn Konstabel
if expects just one condition (no vectors); see ?ifelse dataframe$thevector <- ifelse(dataframe$factor=="3", a.mean, dataframe$thevector) K On Wed, Oct 1, 2008 at 12:05 PM, Whitt Kilburn <[EMAIL PROTECTED]> wrote: > Hello all, > > I apologize for a terribly simple question. I'm used to using

[R] an unsophisticated question about recoding in a data frame with control structure if {}

2008-10-01 Thread Whitt Kilburn
Hello all, I apologize for a terribly simple question. I'm used to using Stata and am trying to `switch' over to R. I would like to recode a vector in a data frame when the value of it meets the following condition: if (dataframe$factor=='3'){dataframe$thevector<-(an arithmetic mean). Wh