0
I have a sample dataset which is as follows:
father<- c(1, 1, 1, 0, 0)
mother<- c(1, 1, 1, 0, 0)
children <- c(0, 0, 2, 5, 2)
cousins <- c(0, 5, 1, 1, 4)
dataset <- data.frame(father, mother, children, cousins)
dataset
father mother children cousins
1 1 0 0
1 1 0 5
1 1 2 1
0 0 5 1
0 0 2 4
I would like to apply a condition-based filter so I can get all fathers marked with a '1' and mothers would be 0 OR children would be 0 OR cousins would be 0. In addition, I would also like this filter to select for all fathers with a 0 AND mothers with a 0 AND children with a 0 AND cousins with a 0. Any ideas on how I can go about creating such a filter for my dataset.
Thank you!