Please see my code below. 

I have a data frame where each race a person identifies with is in a column (ex. AWHITE, ABLACK, etc.) and if they identify with this race then the entry is 1 (if not the entry is 2). Respondents can identify with more than one race. 

I'm trying to identify when a respondent has stated they belong to more than one race. If they do, I want one column (ARACE) to update to 91 and another column (AOTHRACE) to become 2. 

The if statement (in the code below) is always evaluating to TRUE. Even though this is not correct. There are respondents who identify as only one race (i.e. white). I've looked this over multiple times, but I can't find where I've messed up.

I plan to use more if statements (if, else if) for the other races/columns as well (i.e. a respondent identifies as black AND at least one other race), but I can't even get the first one to work, so I haven't implemented that.

(I don't actually want the else to be 0, I just used that to confirm the code wasn't working as expected. When I ran the summary function on ARACE the minimum was 91, so I know this statement was never evaluated.)

```
i <- 0
while (i <= nrow(nhes05v2)){
  if ((nhes05v2$AWHITE == 1) && (any(nhes05v2$ABLACK==1, nhes05v2$AAMIND==1, nhes05v2$AASIAN==1, nhes05v2$APACI==1))){
    nhes05v2$ARACE = 91
    nhes05v2$AOTHRACE = 2}
  else {nhes05v2$ARACE = 0
  nhes05v2$AOTHRACE = 0}
  i <- i+1}

```

Here's an example of the values:

```
> nhes05v2$AWHITE[1:20]
 [1] 1 1 1 1 1 1 2 2 2 1 1 2 1 1 1 1 1 1 1 1
> nhes05v2$ABLACK[1:20]
 [1] 2 1 2 2 2 2 1 1 1 2 2 1 2 2 2 2 2 2 2 2
> nhes05v2$AASIAN[1:20]
 [1] 2 2 2 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2
> nhes05v2$AAMIND[1:20]
 [1] 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2
> nhes05v2$APACI[1:20]
 [1] 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2

```

I would like the output to be something like *(this would be with more than just my one if statement above, there'd be more `if, else if`, but since I'm stuck on the first I haven't gone past that)*

```
> nhes05v2$ARACE[1:20]
 [1] 0 91 0 91 0 91 91 0 0 91 0 0 0 0 0 0 0 0 0 0
> nhes05v2$AOTHRACE[1:20]
 [1] 0 2 0 2 0 2 2 0 0 2 0 0 0 0 0 0 0 0 0 0

```

Currently the output is

```
> nhes05v2$ARACE[1:20]
 [1] 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91 91
> nhes05v2$AOTHRACE[1:20]
 [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2

```