groupVecExtValid {splusTimeDate} | R Documentation |
groupVec
Extended Class Validation
Description
Checks the validity for classes that extend the groupVec
class.
Usage
groupVecExtValid(object, names, classes, checkrest = FALSE)
Arguments
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 |
Details
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 thatobject
is a validgroupVec
object.The column names in the
names
slot ofobject
are checked against thenames
argument, and the column classes in theclasses
slot ofobject
are checked against theclasses
argument.If
checkrest
istrue
, thegroupVecNonVec
function is called to check whether the non-groupVec
slots ofobject
havelength
<= 1.
Value
returns TRUE
if object
is valid; otherwise returns a descriptive string.
See Also
groupVecValid
, groupVecNonVec
, groupVec
class
Examples
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)