Convert To Adjacency Matrix In R