Sorry I was in a hurry when I answered and yet willing to point you to mutate + pmap.
Obiously,we need to make a function that handles a 3 component list - the row of df.
Sorry for that.
Thank you @EconomiCurtis for correcting my answer. This is how to use pmap here.
To complete, it is possible to name your arguments' function and use the column name.
Also, you can use pmap_lgl to flatten the result.
library(tidyverse)
n <- 100
z0 <- data_frame(A = sample(c("y","n",NA), n, replace = T, prob = c(.4,.4,.1)),
B = sample(c("y","n",NA), n, replace = T, prob = c(.4,.4,.1)),
C = sample(c("y","n",NA), n, replace = T, prob = c(.4,.4,.1)))
z0 %>%
mutate(new = pmap_lgl(., function(A, B, C) any("y" %in% c(A, B, C))))
#> Warning: le package 'bindrcpp' a été compilé avec la version R 3.4.4
#> # A tibble: 100 x 4
#> A B C new
#> <chr> <chr> <chr> <lgl>
#> 1 y n n TRUE
#> 2 n n n FALSE
#> 3 <NA> y n TRUE
#> 4 y y <NA> TRUE
#> 5 <NA> n y TRUE
#> 6 y y n TRUE
#> 7 <NA> n n FALSE
#> 8 n <NA> n FALSE
#> 9 n n y TRUE
#> 10 n y y TRUE
#> # ... with 90 more rows
Created on 2018-04-19 by the reprex package (v0.2.0).