Dear R users,
I have 4 columns with 0 and 1 values.
x1 x2 x3 x4
1 0 0 1
0 1 1 0
0 0 0 0
0 0 0 1
Now I want to create the 5th column ( x5) like
x1 x2 x3 x4 x5
1 0 0 1 1
0 1 1 0 1
0 0 0 0 0
0 0 0 1 1
I want to create one new column based on my row values. for example, if my one-row has 1 (x1 to x4) then-new the row should assign as 1. If a row does not have 1 then a new row should assign as 0.
please provide some information on that.
Thank You