triplet | R Documentation |
Returns a list containing the indices and elements of a spam
object.
triplet(x, tri=FALSE)
x |
sparse matrix of class |
tri |
Boolean indicating whether to create individual row and column indices vectors. |
The elements are row (column) first if x
is a spam
object (matrix).
A list with elements
indices |
a by two matrix containing the indices if
|
i , j |
vectors containing the row and column indices if |
values |
a vector containing the matrix elements. |
Reinhard Furrer
spam.creation
for the inverse operation and
foreign
for other transformations.
x <- diag.spam(1:4)
x[2,3] <- 5
triplet(x)
all.equal( spam( triplet(x, tri=TRUE)), x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.