groupVec Extended Class Validation

DESCRIPTION:

Check whether all slots of an object are either not vectors or have length <= 1, for use in validation checks.

USAGE:

groupVecNonVec(object, exceptSlots) 

REQUIRED ARGUMENTS:

object
object whose slots are to be checked.

OPTIONAL ARGUMENTS:

exceptSlots
if present, do not check these slots.

VALUE:

T if the slots in the object are atomic or not vector objects, excluding the slots in exceptSlots, and a descriptive string if this is not true.

DETAILS:

The function loops through all the slots of the object, and for each one checks to see that the data in it is either not a vector class, or if it is that it has length <= 1.

SEE ALSO:

.

EXAMPLES:

setClass("myclass", representation("groupVec", a = "numeric")) 
obj <- new("myclass") 
groupVecNonVec(obj) 
obj@a <- 1:5 
groupVecNonVec(obj) 
groupVecNonVec(obj, "a")