\name{positiveIndex-class} \docType{class} \alias{positiveIndex-class} \alias{Arith,positiveIndex,numeric-method} \alias{Arith,numeric,positiveIndex-method} \alias{[,positiveIndex,sliceIndex,missing,ANY-method} \alias{[,positiveIndex,positiveIndex,missing,ANY-method} \alias{[,positiveIndex,ANY,missing,ANY-method} \alias{allNA,positiveIndex-method} \alias{anyNA,positiveIndex-method} \alias{as.integer,positiveIndex-method} \alias{coerce,integer,positiveIndex-method} \alias{coerce,numeric,positiveIndex-method} \alias{initialize,positiveIndex-method} \alias{dim<-,positiveIndex,ANY-method} \title{Class "positiveIndex", index class representing a sequence of non-negative integers } \description{ This represents a subscript of arbitrary non-negative integers. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("positiveIndex", val)}. If \code{val} is missing, the result is an object of class \code{"positiveIndex"} of length \code{0}. Otherwise, it is coerced to an integer and an object of class \code{"positiveIndex"} is created which has the same \code{.Data} slot as \code{val}. The \code{rangeIndex} and \code{noNA} slots are calculated by the initialization code. } \section{Slots}{ \describe{ \item{\code{.Data}:}{Object of class \code{"integer"}, the actual index values. } \item{\code{rangeIndex}:}{Object of class \code{"integer"} of length \code{2}, same as \code{range(.Data)}. } \item{\code{noNA}:}{Object of class \code{"logical"} of length 1, same as \code{!any(is.na(.Data))}. } } } \section{Extends}{ Class \code{"integer"}, 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} with \code{x@.Data} replaced by \code{x@.Data+scalar}. } \item{\code{scalar+x}}{ Add \code{scalar} to \code{x}. Result is \code{x} with \code{x@.Data} replaced by \code{x@.Data+scalar}. } \item{\code{x*scalar}}{ Multiply \code{x} by \code{scalar}. Result is \code{x} with \code{x@.Data} replaced by \code{x@.Data*scalar}. } \item{\code{scalar*x}}{ Multiply \code{x} by \code{scalar}. Result is \code{x} with \code{x@.Data} replaced by \code{x@.Data*scalar}. } \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{"sliceIndex"} or of class \code{"positiveIndex"}. } \item{\code{x[]}}{ Subset x with the subscript missing. Result is x. } \item{\code{allNA(x)}}{ Are all elements of \code{x} \code{NA}? Result is \code{all(is.na(x@.Data))}. } \item{\code{anyNA(x)}}{ Is any element of \code{x} \code{NA}? Result is \code{any(is.na(x@.Data))}. } \item{\code{as.integer(x)}}{ Convert \code{x} to an R subscript - adds 1 to each element of \code{x@.Data}. } \item{\code{initialize(.Object, .Data)}}{ Initialize \code{.Object}. } } } \keyword{classes}