dim {spam}R Documentation

Dimensions of an Object

Description

Retrieve or set the dimension of an spam object.

Usage

# dim(x)
# dim(x) <- value
"dim<-.spam"(x,value)

Arguments

x a spam matrix
value A numeric two-vector, which is coerced to integer (by truncation).

Details

It is important to notice the different behavior of the replacement method for ordinary arrays and spam objects (see ‘Examples’). Here, the elements are not simply rearranged but an entirely new matrix is constructed. If the new column dimension is smaller than the original, the matrix is also cleaned (with spam.option("eps") as filter).

For the same operation as with regular arrays, use spam

Value

dim retrieves the dimension slot of the object. It is a vector of mode integer.
The replacemnt method changes the dimension of the object by truncation or extension (with zeros).

Author(s)

Reinhard Furrer

See Also

dim.

Examples

x <- diag(4)
dim(x)<-c(2,8)
x

s <- diag.spam(4)
dim(s) <- c(7,3)  # any positive value can be used

s <- diag.spam(4)
dim(s) <- c(2,8)  # result is different than x


[Package spam version 0.15-3 Index]