NAIndex-class {externalVector}R Documentation

Class "NAIndex", index class representing a subscript of all NA's for a vector or an array dimension

Description

When used as a subscript for a vector object x, this is equivalent to rep(NA, length(x)). When used as a subscript for the i-th dimension of an array object x, this is equivalent to rep(NA, dim(x)[i]).

Objects from the Class

Objects can be created by calls of the form new("NAIndex", Length, Names). Length must be a non-negative integer. Default value for Length is 0. The Names argument, if not missing, must be of length Length. If missing, Names is taken to be NULL.

Slots

.Data:
Object of class "logical", this is always same as NA.
Length:
Object of class "integer", this is the length of the index.
Names:
Object of class "vectorNamesType", this contains names associated with the elements of the index (if any).

Extends

Class "logical", directly. Class "vectorIndex", directly.

Methods

Signature components for the methods are:

x The class "allIndex"
scalar Length one positive "integer"
i The class "ANY"
value The class "ANY"
.Object The class "allIndex"
x+scalar:
Add scalar to x. Result is x.
scalar+x:
Add scalar to x. Result is x.
x*scalar:
Multiply x by scalar. Result is x.
scalar*x:
Multiply x by scalar. Result is x.
dim(x) <- value
Set a dimension on x. If value is of length 2, this may create a "matrixIndex".
x[i]:
Subset x. If length of i is 0, the result is an object of class "noneIndex". Otherwise, the result is an object of class "NAIndex" with same length as i.
x[]:
Subset x with the subscript missing. Result is x.
x[i] <- value:
Subassign x. Results in an error (as objects from class "allIndex" are not mutable.
x[[i]] <- value:
Subassign x. Results in an error (as objects from class "allIndex" are not mutable.
allNA(x):
Are all elements of x NA? Result is always FALSE.
anyNA(x):
Is any element of x NA? Result is always FALSE.
initialize(.Object, Length=0, Names):
Initialize an object from class "allIndex".
length(x):
Return the length of x which is always Inf.
length(x) <- value:
Modify the length of x. If value is 0, makes x an object of class "noneIndex". Otherwise, modifies length of x to value.
names(x):
Returns the Names slot of x.
names(x) <- value:
Sets the Names slot of x to value.

See Also

vectorIndex-class for the super class of "NAIndex".


[Package externalVector version 1.0.14 Index]