read.matrix(file, header = FALSE, skip = 1, row.ids = NULL, col.ids = NULL, colClasses = c('character','character','numeric'), assign.fn = assignMatrixDense, filter.fn = NULL, ...) The primary benefit of this function is that named rows and columns can be
used as opposed to integer indexes, as compared to the slam package.
The other main motivation is that if the memory is available, dense matrix
calculations can be faster than their sparse counterparts, not to mention
having a wider range of operators available.
When header == TRUE, the row names and/or column names are read from the file. The names are expected to be comma separated in a single line.
Various methods can be used to construct a sparse matrix representation
that is used as the basis for constructing the dense matrix. Currently only
the assignMatrixDense function is available, which works well for
matrices in triplet form.
## Not run:
# path <- system.file('sample-data/triplet.csv', package='futile.matrix')
# m <- read.matrix(path)
#
# rows <- paste('row', 1:10000, sep='.')
# cols <- paste('col', 1:10000, sep='.')
# n <- read.matrix(path, row.ids=rows, col.ids=cols)
# ## End(Not run)
Run the code above in your browser using DataLab