powered by
Returns a list containing the indices and elements of a spam object.
spam
triplet(x, tri=FALSE)
A list with elements
a by two matrix containing the indices if tri=FALSE.
tri=FALSE
vectors containing the row and column indices if tri=TRUE.
tri=TRUE
a vector containing the matrix elements.
sparse matrix of class spam or a matrix.
Boolean indicating whether to create individual row and column indices vectors.
Reinhard Furrer
The elements are row (column) first if x is a spam object (matrix).
x
spam.creation for the inverse operation and foreign for other transformations.
spam.creation
foreign
x <- diag.spam(1:4) x[2,3] <- 5 triplet(x) all.equal( spam( triplet(x, tri=TRUE)), x)
Run the code above in your browser using DataLab