Hello, I have a data frame like this:
> head(b) FID IID FLASER PLASER 1: fam1000 G1000 1 1 2: fam1001 G1001 1 1 3: fam1003 G1003 1 2 4: fam1005 G1005 1 1 5: fam1009 G1009 2 1 6: fam1052 G1052 1 1 ... My conditions for creating a new column PHENO would be this: if FLASER or PLASER =2 then PHENO=2 otherwise PHENO=1 so result would look like this: > head(b) FID IID FLASER PLASER PHENO 1: fam1000 G1000 1 1 1 2: fam1001 G1001 1 1 1 3: fam1003 G1003 1 2 2 4: fam1005 G1005 1 1 1 5: fam1009 G1009 2 1 2 6: fam1052 G1052 1 1 1 ... Thanks Ana ... ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.