Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ScalarObject-class

Utility classes for length one (scalar) objects


Description

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, ScalarLogical, 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).

Usage

mkScalar(obj)

Arguments

obj

An object of type character, logical, integer, or double

Author(s)

Seth Falcon

Examples

v <- list(mkScalar("a single string"),
          mkScalar(1),
          mkScalar(1L),
          mkScalar(TRUE))
sapply(v, class)
sapply(v, length)

Biobase

Biobase: Base functions for Bioconductor

v2.50.0
Artistic-2.0
Authors
R. Gentleman, V. Carey, M. Morgan, S. Falcon
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.