I am trying to split a binary column into two separate columns based on the 0,1
account
row1 0
row2 1
row3 0
row4 1
row5 0
row6 0
account_0 | account_1
row1 0 |
row2 | 1
row3 0 |
row4 | 1
row5 0 |
row6 0 |
I tried using the separate
function. But it is expecting a delimiter to separate the columns
test=separate(df, col = account, into = c("account_0","account
-1"), sep = ?) [not sure what to pass for the argument "sep"]
View(test)
Can someone please help?