See FAQ: What's a reproducible example (`reprex`) and how do I do one?
If I understood your test correctly, that you want to create a new variable representing the highest score between the parents.
The |
tests both parents for and returns 1
if any of the conditions are true
- Both parents are coded 1
- Father is coded 1
- Mother is coded 1
If none of these are satisfied, the new variable is coded 0, because neither both parents nor neither parent is coded 1.