DexiScale-class {DEXiR} | R Documentation |
DexiScale
Description
DexiScale
is a base RC class representing value scales in R.
Details
A value scale defines the type and set of values that can be assigned to some DexiAttribute. DexiScale is a base scale class that defines fields and methods common to all scales:
whether or not the scale is preferentially ordered (and in which direction),
scale type (discrete or continuous),
the number of scale elements, if countable,
partition of scale elements in three preferential classes:
"bad"
,"good"
and"none"
,helper methods
value_index()
andfull_range()
.
DEXiR implements two other scale classes derived from DexiScale
:
DexiContinuousScale and DexiDiscreteScale.
Fields
order
character. Preferential order of the scale. Possible values:
"ascending"
,"descending"
or"none"
.
Methods
count()
Return the number of scale elements. Equal to
NA
forDexiScale
,0
forDexiContinuousScale
, and equal tonvals >= 0
forDexiDiscreteScale
.equal(scl)
Check if this scale is equal to scale
scl
. Needed for attribute linking.full_range()
Return the vector that represents the full range of values on this scale. Equal to
NA
forDexiScale
andDexiContinuousScale
, and1 : scale$nvals
forDexiDiscreteScale
.initialize(order = EnumOrder, ...)
Initialize a
DexiScale
object.is_continuous()
Logical: Is this scale continuos?
is_discrete()
Logical: Is this scale discrete?
to_string()
Return a string representation of this scale for printing.
value_index(value)
Find the index of
value
(character(1)) on this scale. Equal toNA
forDexiScale
andDexiContinuousScale
. WithDexiDiscreteScale
objects, it returns a numeric index orNA
ofvalue
inscale$values
.value_quality(value)
Return the quality (preferential class) of
value
on this scale: one of the strings"bad"
,"none"
or"good"
. Always"none"
forDexiScale
and scales withorder = "none"
.verify()
Check the correctnes of this scale object and its fields. Result:
error()
orTRUE
.