Skip to content
Prev 201513 / 398506 Next

Split column

I have a further question. If there is NA (missing data) in the original
dataset, just like this:

id   var1   var2   
 1      1      3   
 2      3      1   
 3      NA    1   
 4      1      2   
 5      2      3   

how to deal with it? The converted dataset should be this:

id   var1.1  var1.2  var2.1  var2.2 
1         1       1       2       2 
2         2       2       1       1
3         NA     NA     1       1
4         1       1       1       2
5         1       2       2       2

Thanks.

Lisa

The
Henrique Dallazuanna wrote: