first the data, then my question:

```
df <- data.frame(Z=c(1,2,3),Y=c(2,3),A=c(1,2,3,4,5,6))
df
Z Y A
1 2 1
2 2 2
3 2 3
1 3 4
2 3 5
3 3 6

```

I am using R and would like to generate a vector a with given vector `Z` and `Y`. Like if `(z1==1 & y1==2)`, then `a1=1`, if `(z3==3 & y1==2)`, then `a1=3`....If we only have one condition (`Z` or `Y`), I could generate `A` with switch function, however, how could I generate `A` with `Z` and `Y`?