Re: [R] if else statements in data frame

From: ozgrerg <>
Date: Sat, 16 Apr 2011 15:17:28 -0700 (PDT)

Thanks for the answers. They were very helpful. I did it like below.

data$z <- ifelse(data$x == "A" & data$y == "A", "NA", "B").

That is enough for today. I guess I learned a enough today. Thanks to everbody who tried to help.

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 17 Apr 2011 - 00:01:57 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 17 Apr 2011 - 00:40:30 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive