triplet {spam}R Documentation

Transform a spam format to triplets

Description

Returns a list containing the indices and elements of a spam object.

Usage

triplet(x)

Arguments

x sparse matrix of class spam or a matrix.

Details

The elements are row (column) first if x is a spam object (matrix).

Value

A list with elements

indices a matrix containing the indices
elements a vector containing the elements

Author(s)

Reinhard Furrer

See Also

spam.list for the inverse operation and foreign for other transformations.

Examples

triplet(diag.spam(4))

[Package spam version 0.15-0 Index]