as.banded: as.banded

Description Usage Arguments Details Value References See Also Examples

Description

Convert a regular R matrix into a banded matrix.

Usage

1
as.banded(x, kl, ku)

Arguments

x

A matrix containing numeric, integer, or logical data.

kl, ku

The size of the lower and upper bands. At least one value kl or ku must be supplied; however, if one is missing, the other will be assumed to be the same value. Each supplied value should be a non-negative integer. See the details section for more information about these values.

Details

The values kl and ku describe the bandwidth of the band matrix. If they are different, they will produce a general banded matrix. If they are both 0, they will produce a diagonal matris.

Value

A banded matrix.

References

http://www.netlib.org/lapack/lug/node124.html

See Also

kdim and classes

Examples

1
2
3
4
5
6
7
x <- matrix(1:25, nrow=5)

# A diagonal matrix
as.banded(x, 0)

# A general banded matrix
as.banded(x, 2, 1)

wrathematics/band documentation built on May 4, 2019, 9:48 a.m.