View source: R/validateClasses.R
validateClasses | R Documentation |
Validity check capable of validating multiple slots in a single call.
validateClasses(object, expected, subset = FALSE)
object |
Object. |
expected |
|
subset |
|
To be used inside S4 setValidity()
call or with
validate()
. Particularly useful for checking multiple slotted objects
inside metadata()
.
logical(1)
(TRUE
) on sucess or character(1)
containing
informative message on failure.
Updated 2023-04-26.
validate()
.
methods::setValidity()
.
methods::validObject()
.
## TRUE ====
validateClasses(
object = list(
"a" = character(),
"b" = integer(),
"c" = factor()
),
expected = list(
"a" = "character",
"b" = "integer",
"c" = "factor"
)
)
## FALSE ====
validateClasses(
object = list(
"a" = character(),
"b" = integer(),
"c" = factor()
),
expected = list(
"a" = "character",
"b" = "character",
"c" = "character"
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.