Learn R Programming

objectProperties (version 0.5.1)

setNumericWithRange: Define a speicific range object

Description

This class creator is used to define a special property for numeric range, which could be used for UI design and could be setted as signaling field, so it will support validation on the input.

Usage

setNumericWithRange(prefix, min, max, where=topenv(parent.frame()))

Arguments

prefix
Prefix for new class name.
min
Minimal value for this range object.
max
Maximal value for this range object.
where
the environment in which to store or remove the definition. Defaults to the top-level environment of the calling function.

Value

  • A S4 class name.

Details

The purpose of creating such a class genenrator is to define a special range properties which could be set as singaling field, such as Parameters object. Then validation will be turned on automatically to make sure the current value is within the defined range. This is particular useful when you try to design a slider widget of such a property, let's say, a alpha blending slider.