methods.sparse3Darray {spatstat.sparse}R Documentation

Methods for Sparse Three-Dimensional Arrays

Description

Methods for the class "sparse3Darray" of sparse three-dimensional arrays.

Usage

 ## S3 method for class 'sparse3Darray'
anyNA(x, recursive = FALSE)
 ## S3 method for class 'sparse3Darray'
dim(x)
 ## S3 replacement method for class 'sparse3Darray'
dim(x) <- value
 ## S3 method for class 'sparse3Darray'
dimnames(x)
 ## S3 replacement method for class 'sparse3Darray'
dimnames(x) <- value
 ## S3 method for class 'sparse3Darray'
print(x, ...)

Arguments

x

A sparse three-dimensional array (object of class "sparse3Darray").

value

Replacement value (see Details).

recursive, ...

Ignored.

Details

These are methods for the generics anyNA, dim, dim<-, dimnames, dimnames<- and print for the class "sparse#Darray" of sparse three-dimensional arrays.

For dimnames(x) <- value, the value should either be NULL, or a list of length 3 containing character vectors giving the names of the margins.

For dim(x) <- value, the value should be an integer vector of length 3 giving the new dimensions of the array. Note that this operation does not change the array positions of the non-zero entries (unlike dim(x) <- value for a full array). An error occurs if some of the non-zero entries would lie outside the new extent of the array.

Value

anyNA returns a single logical value.

dim returns an integer vector of length 3.

dimnames returns NULL, or a list of length 3 whose entries are character vectors.

dim<- and dimnames<- return a sparse 3D array.

print returns NULL, invisibly.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner rolfturner@posteo.net and Ege Rubak rubak@math.aau.dk.

See Also

sparse3Darray

Examples

 M <- sparse3Darray(i=1:4, j=sample(1:4, replace=TRUE),
                    k=c(1,2,1,2), x=1:4, dims=c(5,5,2))

 anyNA(M)
 dim(M)
 dimnames(M)
 dimnames(M) <- list(letters[1:5], LETTERS[1:5], c("Yes", "No"))
 print(M)

[Package spatstat.sparse version 3.1-0 Index]