Skip to content
Prev 383536 / 398502 Next

how to create a new column from two columns with conditions

Hi Rui,

thanks for getting back to me
so I tried your method and I got:
[1] 828
[1] 859

Can you please tell me if
b$PHENO <- (b$FLASER == 2 | b$PLASER == 2) + 1L

just assigns PHENO=2 if b$FLASER == 2 | b$PLASER == 2 and everything else is 1?

Please see how my data looks like:
[1] 92
[1] 1533
[1] 850
[1] 806
[1] 1698    5
[1]  1  3  2 NA
[1]  1  2  3 NA
On Wed, Apr 29, 2020 at 4:10 PM Rui Barradas <ruipbarradas at sapo.pt> wrote: