\name{NAIndex-class} \docType{class} \alias{NAIndex-class} \alias{Arith,numeric,NAIndex-method} \alias{Arith,NAIndex,numeric-method} \alias{[,NAIndex,ANY,ANY,ANY-method} \alias{[,NAIndex,noneIndex,ANY,ANY-method} \alias{[,NAIndex,allIndex,ANY,ANY-method} \alias{[<-,NAIndex,ANY,ANY,ANY-method} \alias{[[<-,NAIndex-method} \alias{allNA,NAIndex-method} \alias{anyNA,NAIndex-method} \alias{initialize,NAIndex-method} \alias{length,NAIndex-method} \alias{length<-,NAIndex-method} \alias{names,NAIndex-method} \alias{names<-,NAIndex,ANY-method} \alias{names<-,NAIndex,externalVector-method} \alias{dim<-,NAIndex,ANY-method} \title{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 \code{x}, this is equivalent to \code{rep(NA, length(x))}. When used as a subscript for the \code{i}-th dimension of an array object \code{x}, this is equivalent to \code{rep(NA, dim(x)[i])}. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("NAIndex", Length, Names)}. \code{Length} must be a non-negative integer. Default value for \code{Length} is \code{0}. The \code{Names} argument, if not missing, must be of length \code{Length}. If missing, \code{Names} is taken to be \code{NULL}. } \section{Slots}{ \describe{ \item{\code{.Data}:}{Object of class \code{"logical"}, this is always same as \code{NA}. } \item{\code{Length}:}{Object of class \code{"integer"}, this is the length of the index. } \item{\code{Names}:}{Object of class \code{"vectorNamesType"}, this contains names associated with the elements of the index (if any). } } } \section{Extends}{ Class \code{"logical"}, directly. Class \code{"vectorIndex"}, directly. } \section{Methods}{ Signature components for the methods are: \tabular{ll}{ x \tab The class "allIndex"\cr scalar \tab Length one positive "integer"\cr i \tab The class "ANY"\cr value \tab The class "ANY"\cr .Object \tab The class "allIndex"\cr } \describe{ \item{\code{x+scalar}:}{ Add \code{scalar} to \code{x}. Result is \code{x}. } \item{\code{scalar+x}:}{ Add \code{scalar} to \code{x}. Result is \code{x}. } \item{\code{x*scalar}:}{ Multiply \code{x} by \code{scalar}. Result is \code{x}. } \item{\code{scalar*x}:}{ Multiply \code{x} by \code{scalar}. Result is \code{x}. } \item{dim(x) <- value}{ Set a dimension on \code{x}. If value is of length 2, this may create a "matrixIndex". } \item{\code{x[i]}:}{ Subset x. If length of \code{i} is \code{0}, the result is an object of class \code{"noneIndex"}. Otherwise, the result is an object of class \code{"NAIndex"} with same length as \code{i}. } \item{\code{x[]}:}{ Subset x with the subscript missing. Result is x. } \item{\code{x[i] <- value}:}{ Subassign x. Results in an error (as objects from class \code{"allIndex"} are not mutable. } \item{\code{x[[i]] <- value}:}{ Subassign x. Results in an error (as objects from class \code{"allIndex"} are not mutable. } \item{\code{allNA(x)}:}{ Are all elements of \code{x} \code{NA}? Result is always \code{FALSE}. } \item{\code{anyNA(x)}:}{ Is any element of \code{x} \code{NA}? Result is always \code{FALSE}. } \item{\code{initialize(.Object, Length=0, Names)}:}{Initialize an object from class \code{"allIndex"}. } \item{\code{length(x)}:}{ Return the length of \code{x} which is always \code{Inf}. } \item{\code{length(x) <- value}:}{ Modify the length of \code{x}. If \code{value} is \code{0}, makes \code{x} an object of class \code{"noneIndex"}. Otherwise, modifies length of \code{x} to \code{value}. } \item{\code{names(x)}:}{ Returns the \code{Names} slot of \code{x}. } \item{\code{names(x) <- value}:}{ Sets the \code{Names} slot of \code{x} to \code{value}. } } } \seealso{ \code{\link{vectorIndex-class}} for the super class of \code{"NAIndex"}. } \keyword{classes}