groupVec Extended Class Validation

DESCRIPTION:

Check validity for classes which extend the groupVec class.

USAGE:

groupVecExtValid(object, names, classes, checkrest=F) 

REQUIRED ARGUMENTS:

object
object to be validated.
names
character vector containing correct column names.
classes
character vector containing correct column classes.

OPTIONAL ARGUMENTS:

checkrest
check that the non- groupVec slots have length <= 1 if T.

VALUE:

T if object is valid, and a descriptive string if it is not.

DETAILS:

This function checks to see whether object is a valid groupVec extending object. There are several steps in this process. First, the groupVecValid function is called to verify that object is a valid groupVec object. Next the column names in the .Data.names slot of object are checked against the names argument, and the column classes in the .Data.classes slot of object are checked against the classes argument. Finally, if checkrest is true, the groupVecNonVec function is called to check whether the non- groupVec slots of object all have length <= 1.

SEE ALSO:

, , class

EXAMPLES:

setClass("myclass", representation("groupVec", a = "numeric")) 
setValidity("myclass",  
   function(object) groupVecExtValid(object, "nums", "numeric", F)) 
setClassPrototype("myclass",  
   list(.Data.names="nums", .Data.classes="numeric", .Data=list(numeric(0)))) 
obj <- new("myclass") 
obj@a <- 1:5 
validObject(obj) 
groupVecExtValid(obj, "nums", "numeric", T)