I would want to dynamically subset a data frame and perform an analysis using one fixed variable and sequentially condition on the other variables. For example, let say I have a 3 variable data frame (in my case I have 10):
x y z
a 1 1
b 3 NA
NA 5 0
f NA 1
I want to subset the data frame conditioning on
1) x, z are not missing
2) y, z are not missing
My targetted output is this:
x z
a 1
f 1
y z
1 1
5 0
I want this pairwise comparison to be done dynamically across all my dataset with n number of variables. The output can be a list.