as_sparse function

Transforms matrix to dgTMatrix