Re: [R] nested ifelse problem

2011-02-09 Thread jim holtman
Read the help page for ifelse again. It return a value; you do not assign values with the the function. You would use it something like this: cbitotal <- ifelse(cond1 , result1 , ifelse(cond2 , result2

Re: [R] nested ifelse problem

2011-02-09 Thread Duncan Murdoch
On 11-02-09 3:47 PM, eck 1 wrote: Hello R-Help users, I have a data frame named fd, a sample of which looks like this: cbi_A cbi_B cbi_B1 cbi_B2 cbi_C cbi_D cbi_E cbi_F 2.183451 1.047546 NA NA NA NA 0.428528 NA 0.795837 0.510152 0.510152 NA NA NA NA NA 0.795837

[R] nested ifelse problem

2011-02-09 Thread eck 1
Hello R-Help users, I have a data frame named fd, a sample of which looks like this: cbi_A cbi_B cbi_B1 cbi_B2 cbi_C cbi_D cbi_E cbi_F 2.183451 1.047546 NA NA NA NA 0.428528 NA 0.795837 0.510152 0.510152 NA NA NA NA NA 0.795837 1.149577 0.843485 1.122334 NA