# NOT RUN {
# create a sparse matrix of 4 X 2
input.file <- rbind(c('R1','C1',1), c('R2','C1',1), c('R2','C2',1),
c('R3','C2',1), c('R4','C1',1))
res <- xSparseMatrix(input.file)
res
# get a full matrix
as.matrix(res)
res <- xSparseMatrix(input.file, columns=c('C1','C2','C3'))
res
# }
Run the code above in your browser using DataLab