I've 3 columns data:
var1 var2 Z
1 2 1.2
3 4 5.4
1 4 2.3
And I Want to convert it to a co-existance matrix like this one below:
1 2 3 4
1 0 1.2 0 2.3
2 0 0 0 0
3 0 0 0 5.4
4 0 0 0 0
Is there any way to do it with R language? Thank you in advance for your time.
Actually I am not familiar with R language but you can use this type of logic I have done in java..