How To Create A Matrix From Data In R