lu.tri: Lower and Upper Triangular Part of a Sparse Matrix

Description Usage Arguments Details See Also Examples

Description

Returns the lower or upper triangular structure or entries of a sparse matrix.

Usage

1
2

Arguments

x

a sparse matrix of class spam

diag

logical. Should the diagonal be included?

Details

Often not only the structure of the matrix is required but the entries as well. For compatibility, the default is only a structure consisting of ones (representing TRUEs). Setting the flag spam.getOption( "trivalues") to TRUE, the function returns the actual values.

See Also

spam.options and diag

Examples

1
2
3
4
5
6
smat <- spam( c( 1,2,0,3,0,0,0,4,5),3)
upper.tri( smat)
upper.tri( smat, diag=TRUE)

spam.options( trivalues=TRUE)
upper.tri( smat)


Search within the spam package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.