I have a dataset like this:
structure(list(year = c(2019, 2019, 2019, 2019, 2019, 2019),
venue = c("Z", "Z", "Z", "Z", "O", "D"), HO = c("X", "Y",
"X", "Y", "W", "J"), AW = c("Y", "X", "W", "T", "T", "X")), row.names = c(NA,
-6L), class = c("tbl_df", "tbl", "data.frame"))
I need to create a categorical variable that returns "yes" or "no".
structure(list(year = c(2019, 2019, 2019, 2019, 2019, 2019),
venue = c("Z", "Z", "Z", "Z", "O", "D"), HO = c("X", "Y",
"X", "Y", "W", "J"), AW = c("Y", "X", "W", "T", "T", "X"),
Cat = c("yes", "yes", "no", "no", "no", "no")), row.names = c(NA,
-6L), class = c("tbl_df", "tbl", "data.frame"))
As note, the first two rows are cases for "yes". These are the same in the attributes "year" and "venue", regardless of the order in "HO" and "AW".
Thanks.