Retrieve or set the dimension of an spam object.

# dim(x)
# dim(x) <- value
<!-- %"dim&lt;-.spam"(x,value) -->

Arguments

x

a spam matrix

value

A numeric two-vector, which is coerced to integer (by truncation).

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 rearranging.

Details

In older version of spam, the behavior of the replacement method was different and is now implemented in pad.spam.

See also

Author

Reinhard Furrer

Examples

x <- diag(4)
dim(x)<-c(2,8)
x
#>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,]    1    0    0    0    0    1    0    0
#> [2,]    0    0    1    0    0    0    0    1

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

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