Learn R Programming

flint (version 0.1.0)

OptionalCharacter-class: Unions of ‘NULL’ and Vector Classes

Description

Class unions in the style of OptionalFunction from package methods, whose purpose is to allow slots dim, dimnames, and names of virtual class flint to be NULL or a vector of suitable type.

OptionalInteger, OptionalList, and OptionalCharacter are the unions of NULL and integer, list, and character, respectively.

Arguments

Examples

Run this code
showClass("OptionalInteger")
showClass("OptionalList")
(oc <- getClass("OptionalCharacter"))

stopifnot(isVirtualClass(oc),
          isClassUnion(oc),
          all(c("NULL", "character") %in% names(oc@subclasses)),
          any(extends("NULL") == "OptionalCharacter"),
          any(extends("character") == "OptionalCharacter"))

getClass("flint")@slots

Run the code above in your browser using DataLab