Learn R Programming

DEXiR (version 1.0.2)

reverse_value: reverse_value

Description

Numeric value(s) x are assumed to lie within the [lb:hb] interval. The function "reverses" x linearly so that x = lb maps to hb and x = hb maps to lb. In DEXiR, this function is used to reverse values defined on a DexiScale from "ascending" to "descending" order or vice versa.

Usage

reverse_value(x, lb, hb)

Value

numeric(). Reversed value.

Arguments

x

numeric(). Value(s) to be reversed.

lb

numeric(). Lower interval bound(s).

hb

numeric(). Upper interval bound(s).

Examples

Run this code
reverse_value(1, 1, 5) # 5
reverse_value(3, 1, 5) # 3
reverse_value(5, 1, 5) # 1
reverse_value(c(1, 3, 5), 1, 5) # c(5, 3, 1)

Run the code above in your browser using DataLab