| groupVecExtValid | R Documentation |
groupVec Extended Class Validation
Checks the validity for classes that extend the groupVec class.
groupVecExtValid(object, names, classes, checkrest = FALSE)
object |
the object to be validated. |
names |
a character vector containing correct column names. |
classes |
a character vector containing correct column classes. |
checkrest |
a logical value. If |
This function checks to see whether an object is a valid groupVec
extending object. These are the steps in this process:
The groupVecValid function is called to verify that object is a valid
groupVec object.
The column names in the names slot of object are
checked against the names argument, and the column classes in
the classes slot of object are checked against the classes
argument.
If checkrest is true, the groupVecNonVec function is called to
check whether the non-groupVec slots of object have length
<= 1.
returns TRUE if object is valid; otherwise returns a descriptive string.
groupVecValid, groupVecNonVec, groupVec class
setClass("myclass", representation(a = "numeric"), contains="groupVec",
prototype=prototype(names="nums", classes="numeric",
columns=list(numeric(0)), a=numeric(0)))
setValidity("myclass",
function(object) groupVecExtValid(object, "nums", "numeric", FALSE))
obj <- new("myclass")
obj@a <- 1:5
validObject(obj)
groupVecExtValid(obj, "nums", "numeric", TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.