as.sparse function

Convert to from dense to sparse representation