Description Usage Arguments Examples
Coerce to and from structured sparse matrices
as("strucMatrix", "sparseMatrix")
as("strucMatrix", "CsparseMatrix")
as("strucMatrix", "dgCMatrix")
as("strucMatrix", "dtCMatrix")
as("strucMatrix", "TsparseMatrix")
as("strucMatrix", "dgTMatrix")
as("strucMatrix", "dtTMatrix")
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | as.strucMatrix(x, ...)
## S3 method for class 'strucMatrix'
as.strucMatrix(x, ...)
## S3 method for class 'dsparseMatrix'
as.strucMatrix(x, ...)
## S3 method for class 'matrix'
as.strucMatrix(x, ...)
## S3 method for class 'factor'
as.strucMatrix(x, ...)
## S3 method for class 'dist'
as.strucMatrix(x, ...)
## S3 method for class 'dCHMsimpl'
as.strucMatrix(x, ...)
## S3 method for class 'strucMatrix'
as.data.frame(x, ...)
## S3 method for class 'strucMatrix'
as.matrix(x, sparse = FALSE, ...)
## S3 method for class 'strucMatrixChol'
as.matrix(x, sparse = FALSE, ...)
|
x |
an object |
... |
dots |
sparse |
return |
1 2 3 4 5 6 7 8 9 10 11 12 | set.seed(1)
m1 <- as.strucMatrix(matrix(rnorm(6), 2, 3))
m2 <- as.strucMatrix(matrix(rbinom(6, 1, 0.5), 2, 3))
m3 <- sparseMatrix(i = 1:10, j = rep(1:5, 2),
x = as.integer(rbinom(10, 1, 0.5)),
giveCsparse = FALSE)
as.strucMatrix(m1)
as.strucMatrix(m2)
as.strucMatrix(m3)
as(m1, "TsparseMatrix")
as(m2, "dgCMatrix")
as(m2, "sparseMatrix")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.