| ScalarObject-class {Biobase} | R Documentation |
These classes represent scalar quantities, such as a string or a
number and are useful because they provide their own validity
checking. The classes ScalarCharacter, ScalarInteger,
and ScalarNumeric all extend their respective base vector types
and can be used interchangeably (except they should always have length
one).
The mkScalar factory function provides a convenient way of
creating Scalar<type> objects (see the examples section below).
mkScalar(obj)
obj |
An object of type character, integer, or
double |
Seth Falcon
v <- list(mkScalar("a single string"),
mkScalar(1),
mkScalar(1L))
sapply(v, class)
sapply(v, length)